CLI2: ::findCommand now return a bool indicating what happened.
This commit is contained in:
@@ -944,7 +944,7 @@ void CLI2::findOverrides ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void CLI2::findCommand ()
|
bool CLI2::findCommand ()
|
||||||
{
|
{
|
||||||
for (auto& a : _args)
|
for (auto& a : _args)
|
||||||
{
|
{
|
||||||
@@ -960,10 +960,13 @@ void CLI2::findCommand ()
|
|||||||
if (context.config.getInteger ("debug.parser") >= 3)
|
if (context.config.getInteger ("debug.parser") >= 3)
|
||||||
context.debug (dump ("CLI2::analyze findCommand"));
|
context.debug (dump ("CLI2::analyze findCommand"));
|
||||||
|
|
||||||
// Stop at first command.
|
// Stop and indicate command found.
|
||||||
break;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Indicate command not found.
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ private:
|
|||||||
void handleTerminator ();
|
void handleTerminator ();
|
||||||
void aliasExpansion ();
|
void aliasExpansion ();
|
||||||
void findOverrides ();
|
void findOverrides ();
|
||||||
void findCommand ();
|
bool findCommand ();
|
||||||
/*
|
/*
|
||||||
void categorize ();
|
void categorize ();
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user