mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-31 01:24:19 +02:00
parent
cdfd4d6da8
commit
898e385891
@ -318,10 +318,16 @@ void CLICommand::ShowCommands(int argc, char **argv, po::options_description *vi
|
||||
aname = argv[autoindex - 1] + 2;
|
||||
pword = aword;
|
||||
|
||||
if (pword == "=")
|
||||
pword = "";
|
||||
} else if (autoindex - 1 >= 0 && argv[autoindex - 1][0] == '-' && argv[autoindex - 1][1] != '-') {
|
||||
aname = argv[autoindex - 1];
|
||||
pword = aword;
|
||||
|
||||
if (pword == "=")
|
||||
pword = "";
|
||||
} else if (aword.GetLength() > 1 && aword[0] == '-' && aword[1] != '-') {
|
||||
aname = aword.SubStr(1, 1);
|
||||
aname = aword.SubStr(0, 2);
|
||||
prefix = aword.SubStr(0, 2);
|
||||
pword = aword.SubStr(2);
|
||||
} else {
|
||||
@ -336,11 +342,11 @@ void CLICommand::ShowCommands(int argc, char **argv, po::options_description *vi
|
||||
if (odesc->semantic()->min_tokens() == 0)
|
||||
goto complete_option;
|
||||
|
||||
BOOST_FOREACH(const String& suggestion, globalArgCompletionCallback(aname, pword)) {
|
||||
BOOST_FOREACH(const String& suggestion, globalArgCompletionCallback(odesc->long_name(), pword)) {
|
||||
std::cout << prefix << suggestion << "\n";
|
||||
}
|
||||
|
||||
BOOST_FOREACH(const String& suggestion, command->GetArgumentSuggestions(aname, pword)) {
|
||||
BOOST_FOREACH(const String& suggestion, command->GetArgumentSuggestions(odesc->long_name(), pword)) {
|
||||
std::cout << prefix << suggestion << "\n";
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user