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

refactor: Pull handling of --no-* bool arguments out of the parser. #148

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

DanCardin
Copy link
Owner

@DanCardin DanCardin commented Sep 16, 2024

Fixes #147

The only thing that feels kind of weird about the implementation here (which...it really shouldn't because it's basically exactly as arbitrary as it was before) is that given some --foo/--no-foo: --foo will unconditionally store_true and --no-foo will unconditionally store_false.

But given that level of information, i dont see how we could infer any other choice though, so it doesn't feel that arbitrary. And what's nice about this solution is that the user can now always manually expand the definition themselves to arrive at whatever behavior they want, without the parser inverting their stated selection.

@DanCardin DanCardin merged commit a9bee72 into main Sep 17, 2024
8 checks passed
@DanCardin DanCardin deleted the dc/no-handling branch September 17, 2024 14:20
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

Successfully merging this pull request may close these issues.

Handling of boolean options starting with "--no-" is confusing
1 participant