def date_options(func):
@click.option(<EOL>'<STR_LIT>', type=Date(), help="<STR_LIT>"<EOL>)<EOL>@click.option(<EOL>'<STR_LIT>', type=Date(), help="<STR_LIT>",<EOL>)<EOL>@click.option(<EOL>'<STR_LIT>', default=None, help="<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL>@functools.wraps(func)<EOL>def wrapper(*args, **kwargs):<EOL><INDENT>since, until, today = kwargs.pop('<STR_LIT>'), kwargs.pop('<STR_LIT>'), kwargs.pop('<STR_LIT>')<EOL>if today is not None:<EOL><INDENT>if today:<EOL><INDENT>date = datetime.date.today()<EOL><DEDENT>else:<EOL><INDENT>date = (None, datetime.date.today() - datetime.timedelta(days=<NUM_LIT:1>))<EOL><DEDENT><DEDENT>elif since is not None or until is not None:<EOL><INDENT>date = (since, until)<EOL><DEDENT>else:<EOL><INDENT>date = None<EOL><DEDENT>kwargs['<STR_LIT:date>'] = date<EOL>return func(*args, **kwargs)<EOL><DEDENT>return wrapper<EOL>
Decorator to add support for `--today/--not-today`, `--from` and `--to` options to the given command. The
calculated date is then passed as a parameter named `date`.