Parametrize discard command

This commit is contained in:
Dmitry Shulyak 2015-09-28 10:44:51 +03:00
parent 79e57e4c07
commit 32cbbaeed8

View File

@ -103,9 +103,16 @@ def revert(uid):
raise click.BadParameter(str(er)) raise click.BadParameter(str(er))
@changes.command() @changes.command()
def discard(): @click.argument('uids', nargs=-1)
change.discard_all() @click.option('--all', is_flag=True, default=True)
def discard(uids, all):
"""
uids argument should be of a higher priority than all flag
"""
if uids:
change.discard_uids(uids)
elif all:
change.discard_all()
@changes.command() @changes.command()
@click.option('--name', default=None) @click.option('--name', default=None)