Skip to content

Instantly share code, notes, and snippets.

@fluffybeing
Created May 4, 2014 22:31
Show Gist options
  • Save fluffybeing/130a9449531f6237df3c to your computer and use it in GitHub Desktop.
Save fluffybeing/130a9449531f6237df3c to your computer and use it in GitHub Desktop.
libcloudcli
import click
@click.group()
@click.pass_context
def cli(ctx):
pass
@cli.command(cls=click.Group)
@click.pass_obj
def AWS(obj):
print("Loaded the AWS API")
@AWS.command(cls=click.Group)
@click.pass_obj
def COMPUTE(obj):
print("There are several resources")
@COMPUTE.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(obj, 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