diff options
author | Giorgio Arena <giorgio.arena@arm.com> | 2017-10-25 15:10:41 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | 0c1d1486ecc7159bfe808cd8d929e2962f53e58e (patch) | |
tree | 4192afbfd90ed85837cd42ed5d49fe1c6b0d19d4 /tests/framework/command_line | |
parent | 33fd07bd27be3cba183b7cacef63ea220c770c23 (diff) | |
download | ComputeLibrary-0c1d1486ecc7159bfe808cd8d929e2962f53e58e.tar.gz |
COMPMID-623 Make command line options case insensitive
Change-Id: I91093ce5d5c8643ada4ecc12b86f5f4eda9ba234
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/93306
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'tests/framework/command_line')
-rw-r--r-- | tests/framework/command_line/CommandLineParser.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/framework/command_line/CommandLineParser.cpp b/tests/framework/command_line/CommandLineParser.cpp index 228b18d842..11eb1f3a4d 100644 --- a/tests/framework/command_line/CommandLineParser.cpp +++ b/tests/framework/command_line/CommandLineParser.cpp @@ -56,7 +56,11 @@ void CommandLineParser::parse(int argc, char **argv) for(int i = 1; i < argc; ++i) { - const std::string option{ argv[i] }; + std::string mixed_case_opt{ argv[i] }; + int equal_sign = mixed_case_opt.find('='); + int pos = (equal_sign == -1) ? strlen(argv[i]) : equal_sign; + + const std::string option = tolower(mixed_case_opt.substr(0, pos)) + mixed_case_opt.substr(pos); std::smatch option_matches; if(std::regex_match(option, option_matches, option_regex)) |