-
When I have a situation like below:
My callback function is being executed twice and that causes errors. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The callback is used both to validate the prompt input, and then independently from that is used to validate the value passed to the option (which in this case came from the prompt). Usually this shouldn't matter, but if you're doing something expensive it might. You could omit the prompt from the option, and instead call |
Beta Was this translation helpful? Give feedback.
The callback is used both to validate the prompt input, and then independently from that is used to validate the value passed to the option (which in this case came from the prompt). Usually this shouldn't matter, but if you're doing something expensive it might. You could omit the prompt from the option, and instead call
prompt
yourself in the command if the option wasn't given.