Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

More flexible handling for boolean arguments #36

Open
AhmedSoliman opened this issue May 1, 2019 · 2 comments
Open

More flexible handling for boolean arguments #36

AhmedSoliman opened this issue May 1, 2019 · 2 comments

Comments

@AhmedSoliman
Copy link
Contributor

In argparse, we only generate an argument for the boolean to set to true but there is no way for the user to explicitly switch it off (pass False).

Our options:

  1. Generate a '--no-X' argument automatically to toggle the boolean. (opinionated decision)
  2. Give the user better control through the @argument to define the behaviour (needs spec)
@toti1212
Copy link
Contributor

Hi @AhmedSoliman
I think other CLI frameworks take the 2nd approach, isn't it? For example, oclif permits to change the default behavior.

@AhmedSoliman
Copy link
Contributor Author

@toti1212 Correct, this needs a design proposal though that we can agree on before we jump to implementation.

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

No branches or pull requests

2 participants