Cli: Fix repository remove auto-complete suggestions

refs #7255
This commit is contained in:
Michael Friedrich 2014-10-27 15:48:52 +01:00
parent 44d961f119
commit 4554b70a97
1 changed files with 14 additions and 0 deletions

View File

@ -130,6 +130,20 @@ std::vector<String> RepositoryObjectCommand::GetPositionalSuggestions(const Stri
const Type *ptype = Type::GetByName(m_Type);
ASSERT(ptype);
return GetFieldCompletionSuggestions(ptype, word);
} else if (m_Command == RepositoryCommandRemove) {
std::vector<String> suggestions;
String argName = "name=";
if (argName.Find(word) == 0)
suggestions.push_back(argName);
if (m_Type == "Service") {
String argHostName = "host_name=";
if (argHostName.Find(word) == 0)
suggestions.push_back(argHostName);
}
return suggestions;
} else
return CLICommand::GetPositionalSuggestions(word);
}