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 support for no value flags #40

Closed
c4spar opened this issue Jun 5, 2020 · 0 comments
Closed

Add support for no value flags #40

c4spar opened this issue Jun 5, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request module:command command module module:flags flags module

Comments

@c4spar
Copy link
Owner

c4spar commented Jun 5, 2020

await new Command()
    .option('--test', 'Test description')
    .option('--test2 [val:boolean]', 'Test2 description')
    .parse(['-h']);

Atm both flags have an optional booelan value but only --test2 should have an optional value.
--help should output:

    --test                           - Test description
    --test2  [val:boolean]  - Test2 description
@c4spar c4spar added enhancement New feature or request module:command command module module:flags flags module labels Jun 5, 2020
@c4spar c4spar self-assigned this Jun 5, 2020
c4spar added a commit that referenced this issue Jun 11, 2020
…s registered per default (#40)

A boolean flag no longer has an optional value per default. To add an optional or required value use the `optionalValue` or `requiredValue` option.
c4spar added a commit that referenced this issue Jun 11, 2020
…was registered per default (#40)

An option defined with `.option('-d, --debug', '...')` has no longer an boolean argument per default.
To add an boolean argument you have add the argument explicitly with `.option('-d, --debug [arg:boolean]', '...')`
c4spar added a commit that referenced this issue Jun 11, 2020
…s registered per default (#40)

A boolean flag no longer has an optional value per default. To add an optional or required value use the `optionalValue` or `requiredValue` option.
c4spar added a commit that referenced this issue Jun 11, 2020
…was registered per default (#40)

An option defined with `.option('-d, --debug', '...')` has no longer an boolean argument per default.
To add an boolean argument you have add the argument explicitly with `.option('-d, --debug [arg:boolean]', '...')`
@c4spar c4spar closed this as completed Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request module:command command module module:flags flags module
Projects
None yet
Development

No branches or pull requests

1 participant