Commit cf9d1ebb authored by aligungr's avatar aligungr

CLI cmd refactor

parent 984b9839
...@@ -80,7 +80,7 @@ static std::optional<opt::OptionsResult> ParseCliCommandCommon(OrderedMap<std::s ...@@ -80,7 +80,7 @@ static std::optional<opt::OptionsResult> ParseCliCommandCommon(OrderedMap<std::s
if (tokens.empty()) if (tokens.empty())
{ {
error = "Empty command"; error = "Empty command";
return {}; return std::nullopt;
} }
subCmd = tokens[0]; subCmd = tokens[0];
...@@ -88,13 +88,13 @@ static std::optional<opt::OptionsResult> ParseCliCommandCommon(OrderedMap<std::s ...@@ -88,13 +88,13 @@ static std::optional<opt::OptionsResult> ParseCliCommandCommon(OrderedMap<std::s
if (subCmd == "commands") if (subCmd == "commands")
{ {
output = DumpCommands(cmdEntries); output = DumpCommands(cmdEntries);
return {}; return std::nullopt;
} }
if (cmdEntries.count(subCmd) == 0) if (cmdEntries.count(subCmd) == 0)
{ {
error = "Command not recognized: " + subCmd; error = "Command not recognized: " + subCmd;
return {}; return std::nullopt;
} }
opt::OptionsDescription desc = cmdEntries[subCmd].descriptionFunc(subCmd, cmdEntries[subCmd]); opt::OptionsDescription desc = cmdEntries[subCmd].descriptionFunc(subCmd, cmdEntries[subCmd]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment