You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have started the process of exploring whether we can move one of our Cmd2 tools over to click-repl to benefit from the Prompt Toolkit backend, but seem to have hit an edge case with Click flags.
This results in the following UI being shown to the user, which erroneously suggests that a value must be provided for the boolean flag. However, as this click argument definition should result in a flag that somewhat mirrors the argparse store_true option, this is wrong:
Furthermore, if one of the options shown (true/false) is chosen, it takes the place of the positional argument arg1 resulting in the following error:
Expected result: when show_flag=True, click-repl should not suggest a parameter for the option as it's a flag. Instead, the user should be prompted to just type the value of the positional argument to get a response, like this:
I suspect the issue lies somewhere in this function, but I don't know enough about Prompt Toolkit completers to fix this myself in the case that is_flag is True.
Thank you in advance!
The text was updated successfully, but these errors were encountered:
I have started the process of exploring whether we can move one of our Cmd2 tools over to click-repl to benefit from the Prompt Toolkit backend, but seem to have hit an edge case with Click flags.
Minimal reproduction:
This results in the following UI being shown to the user, which erroneously suggests that a value must be provided for the boolean flag. However, as this click argument definition should result in a flag that somewhat mirrors the argparse
store_true
option, this is wrong:Furthermore, if one of the options shown (true/false) is chosen, it takes the place of the positional argument
arg1
resulting in the following error:Expected result: when
show_flag=True
, click-repl should not suggest a parameter for the option as it's a flag. Instead, the user should be prompted to just type the value of the positional argument to get a response, like this:I suspect the issue lies somewhere in this function, but I don't know enough about Prompt Toolkit completers to fix this myself in the case that
is_flag
is True.Thank you in advance!
The text was updated successfully, but these errors were encountered: