mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 15:14:07 +02:00
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;
|
String fname = field.Name;
|
||||||
|
|
||||||
if (fname == "__name" || fname == "templates")
|
if (fname == "__name" || fname == "templates" || fname == "type")
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
String suggestion = fname + "=";
|
String suggestion = fname + "=";
|
||||||
|
@ -111,9 +111,12 @@ void RepositoryObjectCommand::InitParameters(boost::program_options::options_des
|
|||||||
|
|
||||||
std::vector<String> RepositoryObjectCommand::GetPositionalSuggestions(const String& word) const
|
std::vector<String> RepositoryObjectCommand::GetPositionalSuggestions(const String& word) const
|
||||||
{
|
{
|
||||||
|
if (m_Command == RepositoryCommandAdd) {
|
||||||
const Type *ptype = Type::GetByName(m_Type);
|
const Type *ptype = Type::GetByName(m_Type);
|
||||||
ASSERT(ptype);
|
ASSERT(ptype);
|
||||||
return GetFieldCompletionSuggestions(ptype, word);
|
return GetFieldCompletionSuggestions(ptype, word);
|
||||||
|
} else
|
||||||
|
return CLICommand::GetPositionalSuggestions(word);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user