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

Return an error if flag is provided twice #441

Open
mitar opened this issue Aug 2, 2024 · 2 comments
Open

Return an error if flag is provided twice #441

mitar opened this issue Aug 2, 2024 · 2 comments

Comments

@mitar
Copy link
Contributor

mitar commented Aug 2, 2024

I had an issue that I made a mistake and instead of:

program -o /path --out .ext

I wrote:

program -o /path -out .ext

And was confused why is program writing out to "ut.ext" directory instead to /path. Is there a way to request kong to fail CLI parsing if a flag is provided twice? So for use cases like -vvv with counters this might be reasonable. And when field type is a slice. But providing multiple flags when field type is not a slice should return an error and not just that later flag silently overrides a prior flag. Or at least there should be an option to control this. What do you think?

@alecthomas
Copy link
Owner

alecthomas commented Aug 3, 2024

Seems like reasonable opt-in behaviour, but it can't be the default because it would be backwards incompatible.

@mitar
Copy link
Contributor Author

mitar commented Aug 3, 2024

Of course.

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

No branches or pull requests

2 participants