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

Should non-boolean options with arity=0 be disallowed? #511

Closed
remkop opened this issue Oct 10, 2018 · 1 comment
Closed

Should non-boolean options with arity=0 be disallowed? #511

remkop opened this issue Oct 10, 2018 · 1 comment
Labels
status: declined ❌ A suggestion or change that we don't feel we should currently apply type: enhancement ✨ type: question ❔
Milestone

Comments

@remkop
Copy link
Owner

remkop commented Oct 10, 2018

(This is a follow-up to #509)

For boolean options ("flags") it makes sense to have arity = "0", meaning, the option takes no parameters. Other types commonly need a value.

This ticket is to determine whether there should be validation in the model to prevent application authors from defining options like the below:

@Option(names = "-x", arity = "0") int x;
@remkop remkop added this to the 3.7 milestone Oct 10, 2018
@remkop remkop modified the milestones: 3.7, 3.8, backlog Oct 19, 2018
@remkop remkop added the status: declined ❌ A suggestion or change that we don't feel we should currently apply label Apr 4, 2019
@remkop
Copy link
Owner Author

remkop commented Apr 4, 2019

The answer is no, this should not be validated.

When the work on #536 is complete, arity = "0" will be the default value for interactive options and positional parameters: by default interactive options will not consume an argument from the command line, but instead prompt the user for input. (After #536 is complete, interactive options may be defined with arity = "0..1" to allow optional password values as command line arguments.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined ❌ A suggestion or change that we don't feel we should currently apply type: enhancement ✨ type: question ❔
Projects
None yet
Development

No branches or pull requests

1 participant