Using CLI parser inside a library #753
Replies: 2 comments
-
I made something like this and it works fine. int mylib_init(){ CLI::App lib{"Library"};
try { |
Beta Was this translation helpful? Give feedback.
-
We do this all the time inside HELICS. CLI11 is also used for parsing config files. In your case if you were just using it to capture environment variables, you can probably just call
|
Beta Was this translation helpful? Give feedback.
-
Hi,
Is it possible to ue CLI library inside a library.
I would like to use it to parse environment variables.
A library doesn't have a main entry, but some init function.would it be possible to do something like
CLI::App mylib{"My library"};
mylib.add_option("--my_option", opt)->envname("MY_OPTION");
CLI11_PARSE(mylib): <- with no argc and argv
Thanks
Beta Was this translation helpful? Give feedback.
All reactions