We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import click, sys from typing import TextIO @click.command() @click.option("--name", type=click.File("r"), default=sys.stdin, show_default=True) def hello(name: TextIO): click.echo('Hello World!') if __name__ == '__main__': hello()
Results in this help output:
$ python main.py hello --help Usage: main.py [OPTIONS] Options: --name FILENAME [default: <_io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8'>] --help Show this message and exit.
Describe the expected behavior that should have happened but didn't.
$ python main.py hello --help Usage: main.py [OPTIONS] Options: --name FILENAME [default: stdin] --help Show this message and exit.
Environment:
The text was updated successfully, but these errors were encountered:
I think you've misread the docs for show_default and you actually want show_default='stdin'
show_default
show_default='stdin'
Sorry, something went wrong.
No branches or pull requests
Results in this help output:
Describe the expected behavior that should have happened but didn't.
Environment:
The text was updated successfully, but these errors were encountered: