Created
May 4, 2014 21:40
-
-
Save fluffybeing/62c637b177096354459e to your computer and use it in GitHub Desktop.
Click Command line app
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() | |
@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