Flag and/or option fallback function · Issue #123 · CLIUtils/CLI11 (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Description
I want to parse special flags that begins with a dash and contains a single digit to mean compression levels for my zip like compression tool.
Right now I need to handle this with a special check inside a callback for positional arguments.
I would like to have something like:
opts.add_flag_fallback("-", [&](const char d) { compressionLevel = d - '0'; }, "Set compression level (0-9)");