Last active
January 25, 2019 17:39
-
-
Save mxmgllm/6a3dd95a7286bbfe7446fe0dc01fb3ac to your computer and use it in GitHub Desktop.
Subcommands CLI #Click
This file contains 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 | |
@click.group() | |
def cli(): | |
pass | |
@cli.command() | |
def initdb(): | |
click.echo('Initialized the database') | |
@cli.command() | |
def dropdb(): | |
click.echo('Dropped the database') | |
if __name__ == '__main__': | |
cli() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment