cxxopts
cxxopts copied to clipboard
Lightweight C++ command line option parser
The README shows that to pass in a vector we need to do something like ``` --my_list=1,-2.1,3,4.5 ``` whereas this does not work. We need to do, ``` --my_list={1,-2.1,3,4.5} ```...
If you use cxxopts like this: ``` std::vector files; cxxopts::Options opts(appName, versionString); opts.add_options() ("files", "", cxxopts::value(files)); opts.parse_positional("files"); ``` And call executable like this (notice the quotes): `./foo /home/bar/file_without_comma "/home/bar/file, with...
The parse function below reset the argc value to one. https://github.com/jarro2783/cxxopts/blob/b0f67a06de3446aa97a4943ad0ad6086460b2b61/include/cxxopts.hpp#L1333-L1334 That function should not change that value, which is out of expectation.
I set -Weffc++ in CMAKE_CXX_FLAGS_RELEASE and got bunch of warnings in my face :(
I feel like I am missing something obvious, but how can I catch exceptions from `parse()` without having to put all my option handling code into the `try..catch` block? C++...
I think that a print() function can be useful to print out the configurations parsed by the user. The description can be reused during the printing. ``` cxxopts::Options options; auto...
The standard C++ library doesn't include any option parsing functionality, but Boost does: [`boost::program_options`](https://www.boost.org/doc/libs/1_69_0/doc/html/program_options.html). Could you possibly post an overview of the differences in functionality (and perhaps dependencies and implementation...
This preserves behaviour with the add_subdirectory stuff. --- This change is [](https://reviewable.io/reviews/jarro2783/cxxopts/181)
I have been trying to get an array of floats passed into cxxopts. My option definition: ```cpp options.add_options("Output") ("p,pattern", "Description.", cxxopts::value()) ``` I specify it on the CLI as ```bash...
I have code (simplified): ``` cxxopts::Options opts("jobsrv", "Job Server"); opts.add_options() ("w,dump-data", "write data to .json", cxxopts::value()->implicit_value("default_filename"), "filename") ("f,file", "file to process (e.g. /dir1/a.txt)", cxxopts::value()) ; opts.parse_positional(vector{ "f" }); opts.positional_help("[...]"); auto...