Skip to content

Flag and/or option fallback function #123

Closed
@sasq64

Description

@sasq64

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("-<digit>", [&](const char d) {
    compressionLevel = d - '0';
}, "Set compression level (0-9)");

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions