Skip to content

Commit a466ebb

Browse files
computersforpeacestephenfin
authored andcommitted
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 <[email protected]> Reviewed-by: Mike Frysinger <[email protected]> Reviewed-by: Stephen Finucane <[email protected]>
1 parent 8bd696b commit a466ebb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

patchwork/bin/pwclient

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,6 @@ def main():
507507
)
508508
update_parser.add_argument(
509509
'-s', metavar='STATE',
510-
required=True,
511510
help='''Set patch state (e.g., 'Accepted', 'Superseded' etc.)'''
512511
)
513512
update_parser.add_argument(
@@ -572,6 +571,9 @@ def main():
572571
sys.exit(1)
573572
commit_str = args.get('c')
574573

574+
if state_str is None and archived_str is None and action == 'update':
575+
update_parser.error('Must specify one or more update options (-a or -s)')
576+
575577
if args.get('n') != None:
576578
try:
577579
filt.add("max_count", args.get('n'))

0 commit comments

Comments
 (0)