From 32cbbaeed88fa7c82d48e74b6f7e0e3a4c5abb1c Mon Sep 17 00:00:00 2001 From: Dmitry Shulyak Date: Mon, 28 Sep 2015 10:44:51 +0300 Subject: [PATCH] Parametrize discard command --- solar/solar/cli/system_log.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/solar/solar/cli/system_log.py b/solar/solar/cli/system_log.py index d0cba114..1e18d4e0 100644 --- a/solar/solar/cli/system_log.py +++ b/solar/solar/cli/system_log.py @@ -103,9 +103,16 @@ def revert(uid): raise click.BadParameter(str(er)) @changes.command() -def discard(): - change.discard_all() - +@click.argument('uids', nargs=-1) +@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() @click.option('--name', default=None)