Option callback always fires even when it is not specified in the command invocation #2997
Unanswered
Andreas3333
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
From the click docs:
I am finding the first part of this statement, " If a parameter is not defined on the command line, the callback will still fire." to be true. However, "Missing parameters fire their callbacks at the very end..." I have not observed to be the case while experimenting.
Basically I am looking for a way to have options with callbacks not fire for them to be optional.
For example:
Invoking:
Results as:
I have experimented with setting a few different parameters on the command option
cat, but have been unable to configure it's callback to not run if the option is not specified. Is it possible to do this in click?Looking for input on this or If I am missing something entirely.
Beta Was this translation helpful? Give feedback.
All reactions