mirror of https://github.com/Icinga/icinga2.git
Improve auto-completion suggestions for the repository command
refs #7255
This commit is contained in:
parent
7db8588980
commit
d16670c4b7
|
@ -81,7 +81,7 @@ std::vector<String> icinga::GetFieldCompletionSuggestions(const Type *type, cons
|
|||
|
||||
String fname = field.Name;
|
||||
|
||||
if (fname == "__name" || fname == "templates")
|
||||
if (fname == "__name" || fname == "templates" || fname == "type")
|
||||
continue;
|
||||
|
||||
String suggestion = fname + "=";
|
||||
|
|
|
@ -111,9 +111,12 @@ void RepositoryObjectCommand::InitParameters(boost::program_options::options_des
|
|||
|
||||
std::vector<String> RepositoryObjectCommand::GetPositionalSuggestions(const String& word) const
|
||||
{
|
||||
const Type *ptype = Type::GetByName(m_Type);
|
||||
ASSERT(ptype);
|
||||
return GetFieldCompletionSuggestions(ptype, word);
|
||||
if (m_Command == RepositoryCommandAdd) {
|
||||
const Type *ptype = Type::GetByName(m_Type);
|
||||
ASSERT(ptype);
|
||||
return GetFieldCompletionSuggestions(ptype, word);
|
||||
} else
|
||||
return CLICommand::GetPositionalSuggestions(word);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue