result.push_back(wline);
}
fclose(fp);
-
+
/* Append a slash if there's only one suggestion and it's a directory */
if ((type == "file" || type == "directory") && result.size() == 1) {
String path = result[0];
found_command:
lock.unlock();
- po::options_description vdesc("Command options");
-
- if (command)
+ if (command) {
+ po::options_description vdesc("Command options");
command->InitParameters(vdesc, hiddenDesc);
-
- visibleDesc.add(vdesc);
+ visibleDesc.add(vdesc);
+ }
if (autocomplete)
return true;
} 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] != '-') {
BOOST_FOREACH(const String& suggestion, command->GetArgumentSuggestions(odesc->long_name(), pword)) {
std::cout << prefix << suggestion << "\n";
}
-
+
return;
complete_option: