aboutsummaryrefslogtreecommitdiff
path: root/utils/command_line/CommandLineParser.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/command_line/CommandLineParser.h')
-rw-r--r--utils/command_line/CommandLineParser.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/utils/command_line/CommandLineParser.h b/utils/command_line/CommandLineParser.h
index f834af8e9f..f82d21ab19 100644
--- a/utils/command_line/CommandLineParser.h
+++ b/utils/command_line/CommandLineParser.h
@@ -225,8 +225,17 @@ inline void CommandLineParser::print_help(const std::string &program_name) const
for(const auto &option : _positional_options)
{
- // TODO(COMPMID-2079): Print help string as well
- std::cout << option->name() << "\n";
+ std::string help_to_print;
+
+ // Extract help sub-string
+ const std::string help_str = option->help();
+ const size_t help_pos = help_str.find(" - ");
+ if(help_pos != std::string::npos)
+ {
+ help_to_print = help_str.substr(help_pos);
+ }
+
+ std::cout << option->name() << help_to_print << "\n";
}
}
} // namespace utils