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

Add: opts.booleanBoth #76

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

EstebanMacanek
Copy link

Add option booleanBoth (couldn't find a better name).

opts.booleanBoth - A boolean, string, or array of strings to always treat as booleans. If true will treat all double hyphenated and single hyphenated arguments without equal signs as boolean (e.g. affects --foo and -f, not --foo=bar or -f=bar). A boolean option will consume the following argument if it is the string true or false (e.g. --foo false).

It may be better to add opts.booleanSingle (e.g. affects -f, not -f=b, --foo or --foo=bar) as complementary to opts.boolean instead of opts.booleanBoth which intersects. But the idea came to me once I had already programmed everything.

I'm an amateur programmer, so the code needs improvement.

#75

@ljharb
Copy link
Member

ljharb commented Jan 27, 2025

The issue would be the place to discuss whether this is a feature that's desired at all. It's still not clear why this is beneficial.

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.

2 participants