Skip to content

Instantly share code, notes, and snippets.

@ThiefMaster
Created June 17, 2015 07:54
Show Gist options
  • Save ThiefMaster/a4e4445d405ab8cde2ae to your computer and use it in GitHub Desktop.
Save ThiefMaster/a4e4445d405ab8cde2ae to your computer and use it in GitHub Desktop.
def _validate_indico_dir(ctx, param, value):
pass
def _validate_name(ctx, param, value):
print ctx.params # does NOT contain indico_dir
@click.command()
@click.argument('name', callback=_validate_name)
@click.option('--indico-dir', envvar='INDICO_DIR', metavar='DIR', default='indico', callback=_validate_indico_dir,
help='path to the indico folder')
def main(name, indico_dir, event, models, blueprint):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment