Skip to content

Instantly share code, notes, and snippets.

@mxmgllm
Last active January 25, 2019 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mxmgllm/6a3dd95a7286bbfe7446fe0dc01fb3ac to your computer and use it in GitHub Desktop.
Save mxmgllm/6a3dd95a7286bbfe7446fe0dc01fb3ac to your computer and use it in GitHub Desktop.
Subcommands CLI #Click
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