diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-06-17 18:25:43 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-06-18 11:14:56 +0000 |
commit | e71eb6f178c77fbe611f66857aeccecf4e8db13b (patch) | |
tree | d2417d7c52391304645662fda64b2137d6272207 /utils | |
parent | 705fd3d90dc58c84dd3ede99bafdd63a7eaf4bd5 (diff) | |
download | ComputeLibrary-e71eb6f178c77fbe611f66857aeccecf4e8db13b.tar.gz |
COMPMID-2079: Print positional argument help
Change-Id: I7308f36bbc9e3a92c99495b49cd8129d992c38e9
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Reviewed-on: https://review.mlplatform.org/c/1363
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'utils')
-rw-r--r-- | utils/command_line/CommandLineParser.h | 13 |
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 |