| |
| |
| |
Multiple key->value option. Finds and parse multiple occurrences of options like key=value in argument list. Example how to use: OdDAI::utils::argv_parser commandLineParser("some.exe"); std::vectorifcFiles = {"c:/a1.txt","c:/a2.txt"}; commandLineParser.add_param(std::make_shared>(ifcFiles, "-ifcFile", "the list of compared files")); Example in args: some.exe ... -ifcFile="c:/1.txt" ... -ifcFile="c:/2.txt" - [ifcFiles == ["c:/1.txt", "c:/2.txt"]] some.exe ... - [ifcFiles == ["c:/a1.txt","c:/a2.txt"]] | |
Flag options value. Set flag to true if option name is at arguments list Example how to use: OdDAI::utils::argv_parser commandLineParser("some.exe"); bool disableText = false; commandLineParser.add_param(std::make_shared(disableText, "-textDisable", "disable text output.")); Example in args: some.exe ... -disableText - [disableText == true] some.exe ... -disableText=true - [disableText == true] some.exe ... -disableText=false - [disableText == false] some.exe ... - [disableText == false] | |
Hard placed option. Should go on the defined place. Example how to use: OdDAI::utils::argv_parser commandLineParser("some.exe"); OdString szTargetFileName; commandLineParser.add_param(std::make_shared>(szTargetFileName, "File name", "target filename")); Example in args: some.exe "f:/path_to_some_file.txt" - [szTargetFileName == "f:/path_to_some_file.txt"] | |
Single key->value option. Finds and parse option like key=value in argument list. Example how to use: OdDAI::utils::argv_parser commandLineParser("some.exe"); OdString benchmarkFileName = "c:/default_file_name.bnc"; commandLineParser.add_param(std::make_shared>(benchmarkFileName, "-benchmark", "path to file benchmark, to compare. Does not used if empty.")); Example in args: some.exe ... -benchmark="c:/some_place/file_name.bnc" - [benchmarkFileName="c:/some_place/file_name.bnc"] some.exe ... - [benchmarkFileName="c:/default_file_name.bnc"] | |
try to implement simple program_options analog | |
|
Copyright © 2002-2022. Open Design Alliance All rights reserved.
|