Last active
April 7, 2018 15:54
-
-
Save d3banjan/02931d2599d63b0826c4cb6bd27224c8 to your computer and use it in GitHub Desktop.
medium-dscookiecutter-example snip03
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 os, click, logging | |
@click.group() | |
def meta_command(): | |
pass | |
@click.command() | |
@click.option('--option',default='default') | |
@click.argument('string',nargs=-1) | |
def first(option,string): | |
print("the argument(s) is(are) \"{}\" with an optional modifier {}".format(",".join(string),option)) | |
@click.command() | |
@click.option('--option',default='default') | |
@click.argument('string',nargs=-1) | |
def second(option,string): | |
print("the argument(s) is(are) \"{}\" with an optional modifier {}".format(",".join(string),option)) | |
meta_command.add_command(first) | |
meta_command.add_command(second) | |
if __name__=='__main__': | |
meta_command() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment