parent
36620f8cc8
commit
dfb1246697
|
@ -786,6 +786,14 @@ const CommandDesc set_option_cmd = {
|
||||||
return { 0_byte, params[1].length(),
|
return { 0_byte, params[1].length(),
|
||||||
options.complete_option_name(params[1], pos_in_token) };
|
options.complete_option_name(params[1], pos_in_token) };
|
||||||
}
|
}
|
||||||
|
else if (token_to_complete == 2 and
|
||||||
|
GlobalOptions::instance().option_exists(params[1]))
|
||||||
|
{
|
||||||
|
OptionManager& options = get_options(params[0], context);
|
||||||
|
String val = options[params[1]].get_as_string();
|
||||||
|
if (prefix_match(val, params[2]))
|
||||||
|
return { 0_byte, params[2].length(), { std::move(val) } };
|
||||||
|
}
|
||||||
return Completions{};
|
return Completions{};
|
||||||
},
|
},
|
||||||
[](const ParametersParser& parser, Context& context)
|
[](const ParametersParser& parser, Context& context)
|
||||||
|
|
|
@ -220,6 +220,11 @@ public:
|
||||||
value, std::move(checker)});
|
value, std::move(checker)});
|
||||||
return *m_options.back();
|
return *m_options.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool option_exists(const String& name) const
|
||||||
|
{
|
||||||
|
return find_option(m_options, name) != m_options.end();
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
std::vector<std::unique_ptr<OptionDesc>> m_descs;
|
std::vector<std::unique_ptr<OptionDesc>> m_descs;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user