aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2015-10-16 16:39:01 -0700
committerStephen Finucane <stephen.finucane@intel.com>2015-10-20 01:51:57 +0100
commita466ebb4e7436849f7b627d93fb466b290f194f9 (patch)
treef4fd788153b943ebbe64d33149ac78433a0c89f8
parent8bd696b94ae486d0908d26e95edb757d3d674916 (diff)
downloadpatchwork-a466ebb4e7436849f7b627d93fb466b290f194f9.tar
patchwork-a466ebb4e7436849f7b627d93fb466b290f194f9.tar.gz
pwclient: require one or more of pwclient -{a,s}
Previously, we required the -s flag for 'pwclient update'. But since we allow updating up to 2 different fields ('archived' and 'state'), drop the required flag, and just enforce that the user must provide -a, -s, or both. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Stephen Finucane <stephen.finucane@intel.com>
-rwxr-xr-xpatchwork/bin/pwclient4
1 files changed, 3 insertions, 1 deletions
diff --git a/patchwork/bin/pwclient b/patchwork/bin/pwclient
index 236b237..2193fd5 100755
--- a/patchwork/bin/pwclient
+++ b/patchwork/bin/pwclient
@@ -507,7 +507,6 @@ def main():
)
update_parser.add_argument(
'-s', metavar='STATE',
- required=True,
help='''Set patch state (e.g., 'Accepted', 'Superseded' etc.)'''
)
update_parser.add_argument(
@@ -572,6 +571,9 @@ def main():
sys.exit(1)
commit_str = args.get('c')
+ if state_str is None and archived_str is None and action == 'update':
+ update_parser.error('Must specify one or more update options (-a or -s)')
+
if args.get('n') != None:
try:
filt.add("max_count", args.get('n'))