def default_state_options(f):
    d1 = click.option('--state', '-s', required=True,
        help='Two-letter state-abbreviation, e.g. NY')
    d2 = click.option('--datefilter', '-d',
        help='A year specified as YYYY, e.g. 2012', default='')
    return d1(d2(f))
Decorator that adds the default options for a state command
dataset/ETHPy150Open openelections/openelections-core/openelex/tasks/utils.py/default_state_options