[PATCH 1/3] pwclient: require one or more of pwclient -{a,s}

Brian Norris computersforpeace at gmail.com
Sat Oct 17 04:05:02 AEDT 2015


Ping on this series? There's some other oustanding mildly conflicting
patches for pwclient too (python3 support, from Mike Frysinger) too. I
can resend whatever you'd like, or rebase if you take other patches
first.

Regards,
Brian

On Wed, May 20, 2015 at 11:36:01PM -0700, Brian Norris wrote:
> 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 at gmail.com>
> ---
> Suggested by Jacob Keller
> 
>  apps/patchwork/bin/pwclient | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/apps/patchwork/bin/pwclient b/apps/patchwork/bin/pwclient
> index 8d1f4766c0bf..c05315afb189 100755
> --- a/apps/patchwork/bin/pwclient
> +++ b/apps/patchwork/bin/pwclient
> @@ -490,7 +490,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(
> @@ -555,6 +554,11 @@ def main():
>              sys.exit(1)
>          commit_str = args.get('c')
>  
> +    if state_str == None and archived_str == None and action == 'update':
> +        sys.stderr.write("Must specify one or more update options (-a or -s)\n")
> +        update_parser.print_help()
> +        sys.exit(1)
> +
>      if args.get('n') != None:
>          try:
>              filt.add("max_count", args.get('n'))
> -- 
> 2.4.1
> 


More information about the Patchwork mailing list