Created
December 30, 2018 12:27
-
-
Save DahlitzFlorian/45707f23b3a18f63ac07f2f9072d6053 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import click | |
| from tool import __version__ | |
| @click.group() | |
| @click.version_option( | |
| __version__, "-V", "--version", message="%(prog)s, version %(version)s" | |
| ) | |
| @click.pass_context | |
| def cli(ctx): | |
| """ | |
| Welcome to the Help Page of tool. | |
| $ tool ... | |
| """ | |
| pass | |
| @cli.command() | |
| @click.option( | |
| "-t", | |
| "--text", | |
| default="Hello World", | |
| help="Text to print" | |
| ) | |
| @click.pass_context | |
| def do(ctx, text): | |
| """Print text.""" | |
| print(text) | |
| if __name__ == "__main__": | |
| cli() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment