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
Hi, I'm having an issue when I add a prompt or password prompt option to my command. It will prompt even if the command doesn't have that option specified when calling the command in terminal.
And the default configs generate a working command that i used to test this:
I added an password_prompt decorator in the main command at my_tool/cli.py:
importclick@click.command()@click.option('--as-cowboy', '-c', is_flag=True, help='Greet as a cowboy.')@click.password_option('--password', '-p', help='Input a password')@click.argument('name', default='world', required=False)defmain(name, as_cowboy):
"""My Tool does one thing, and one thing well."""greet='Howdy'ifas_cowboyelse'Hello'click.echo('{0}, {1}.'.format(greet, name))
Installed in the project virtualenv with pip
pip install --editable .
Calling the my-tool command in virtualenv makes click prompt for the password:
$ my-tool
Password:
As it is an option I thought that it wouldn't prompt it it isn't passed when calling the command.
There is something that I'm missing?
The text was updated successfully, but these errors were encountered:
Hi, I'm having an issue when I add a prompt or password prompt option to my command. It will prompt even if the command doesn't have that option specified when calling the command in terminal.
I used this cookiecutter template to generate the boilerplate code:
https://github.com/nvie/cookiecutter-python-cli
And the default configs generate a working command that i used to test this:
my_tool/cli.py
:As it is an option I thought that it wouldn't prompt it it isn't passed when calling the command.
There is something that I'm missing?
The text was updated successfully, but these errors were encountered: