Skip to content

Unlimited positional and unlimitied option #102

@harrywong

Description

@harrywong

Hi, have a question. I have a situation where there's one unlimited positional and one unlimited option. Like this:

std::vector<std::string> t1, t2;
app->add_option("test1", t1);
app->add_option("--test2", t2);

If you give these arguments: ./test a b c --test2 d e f, then a b c and e f will go to t1, and only d will go to t2.

I've seen in the source code:

// If there are any unlimited positionals, those also take priority

Could you please explain why you design like this? I think in this situation, d e f should go to t2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions