-
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: 2 comments 2 replies
-
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.
-
Hi,
I didn't solve it in the click itself.
I've just added some checks in the callback/validator to make it work...
[image: Zrzut ekranu 2024-08-27 o 10.40.06.png]
pon., 26 sie 2024 o 14:41 yorickdowne ***@***.***> napisał(a):
… @MaciekKrz <https://github.com/MaciekKrz> Can I necro this? Did you ever
solve it? And if so, can you point me to your code please? I am facing the
same issue and going grey
—
Reply to this email directly, view it on GitHub
<#2673 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIP5X5EIOJG2C3SDUVVB3R3ZTMPBNAVCNFSM6AAAAABC56PBGKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTANBVGE2DINQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
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.