diff --git a/src/commands.cc b/src/commands.cc index f08acb34..f8b9f9f9 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -1631,11 +1631,11 @@ const CommandDesc source_cmd = { static String option_doc_helper(const Context& context, CommandParameters params) { - const bool add = params.size() > 1 and params[0] == "-add"; - if (params.size() < 2 + (add ? 1 : 0)) + const bool is_switch = params.size() > 1 and (params[0] == "-add" or params[0] == "-remove"); + if (params.size() < 2 + (is_switch ? 1 : 0)) return ""; - auto desc = GlobalScope::instance().option_registry().option_desc(params[1 + (add ? 1 : 0)]); + auto desc = GlobalScope::instance().option_registry().option_desc(params[1 + (is_switch ? 1 : 0)]); if (not desc or desc->docstring().empty()) return "";