Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supplying the same argument twice doesn't cause error #117

Open
yurivict opened this issue Mar 14, 2023 · 1 comment
Open

Supplying the same argument twice doesn't cause error #117

yurivict opened this issue Mar 14, 2023 · 1 comment
Labels

Comments

@yurivict
Copy link

These arguments:

args::ValueFlag<std::string>  a1  (parser, "a1", "a1", {'d', "arg1"});
args::ValueFlag<std::string>  a2  (parser, "a2", "a2", {'d', "arg2"});

aren't valid since both are activated with -d, but args doesn't fail.

@Taywee Taywee added the bug label Mar 14, 2023
@Taywee
Copy link
Owner

Taywee commented Mar 14, 2023

Yes. That is a shortcoming that is difficult to work around, given the generality of this library (argument groups may be arbitrarily nested and combinations of them are similarly arbitrary). I'd be glad to have the library catch this case and raise an error, but I'm not planning on writing this change myself. I'd happily accept a pull request with an appropriate test case that fixes it, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants