Skip to content

Instantly share code, notes, and snippets.

@fluffybeing
Created May 4, 2014 21:40
Show Gist options
  • Save fluffybeing/62c637b177096354459e to your computer and use it in GitHub Desktop.
Save fluffybeing/62c637b177096354459e to your computer and use it in GitHub Desktop.
Click Command line app
import click
@click.group()
@click.pass_context
def cli(ctx):
pass
@cli.command()
@click.pass_obj
def AWS(ctx):
print("Loaded the AWS API")
@cli.command()
@click.pass_obj
def COMPUTE(ctx):
print("There are several resources")
@cli.command()
@click.option('--RAM', default=4, help='RAM for the node')
@click.option('--name', prompt='Name',
help='Name for the node', required=True)
@click.pass_obj
def CREATENODE(ctx, RAM, name):
print('NODE CREATED %s!' % name)
if __name__ == '__main__':
cli(obj={})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment