-
Notifications
You must be signed in to change notification settings - Fork 124
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
Default value for option when no value is passed #381
Comments
Not in 3.x, but in 4.0 (currently available as a snapshot) you will be able to: https://github.com/ajalt/clikt/blob/4.0/docs/options.md#options-with-an-optional-value Per https://kotlinlang.slack.com/archives/C010B2LR509/p1666710542317029 |
Thanks for the answer and reference! |
Unfortunately,
Would it make sense to get something like |
Is there currently a way to achieve the following behavior (for an exemplary
--foo
string option):--foo
is not specified on the CLI, set the variable tonull
.--foo
is specified without a value, apply a default value.--foo
is specified with a value, use that value.The text was updated successfully, but these errors were encountered: