diff --git a/src/commands.cc b/src/commands.cc index 45c32382..fbed8daa 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -786,6 +786,14 @@ const CommandDesc set_option_cmd = { return { 0_byte, params[1].length(), 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{}; }, [](const ParametersParser& parser, Context& context) diff --git a/src/option_manager.hh b/src/option_manager.hh index d7e225fe..244e1555 100644 --- a/src/option_manager.hh +++ b/src/option_manager.hh @@ -220,6 +220,11 @@ public: value, std::move(checker)}); return *m_options.back(); } + + bool option_exists(const String& name) const + { + return find_option(m_options, name) != m_options.end(); + } private: std::vector> m_descs; };