diff mbox series

Align check-get with other commands operating on patch IDs

Message ID 20220330174024.3315089-1-robh@kernel.org
State Accepted
Headers show
Series Align check-get with other commands operating on patch IDs | expand

Commit Message

Rob Herring March 30, 2022, 5:40 p.m. UTC
check-get doesn't support specifying the project and doesn't support
more than one patch ID like other commands which take patch ID as an
argument. Align check-get with other commands like view and get.

Cc: Olof Johansson <olof@lixom.net>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 man/pwclient.1     | 2 +-
 pwclient/parser.py | 5 +----
 pwclient/shell.py  | 4 ++--
 3 files changed, 4 insertions(+), 7 deletions(-)

Comments

Stephen Finucane April 1, 2022, 3:11 p.m. UTC | #1
On Wed, 2022-03-30 at 12:40 -0500, Rob Herring wrote:
> check-get doesn't support specifying the project and doesn't support
> more than one patch ID like other commands which take patch ID as an
> argument. Align check-get with other commands like view and get.
> 
> Cc: Olof Johansson <olof@lixom.net>
> Signed-off-by: Rob Herring <robh@kernel.org>

Reviewed-by: Stephen Finucane <stephen@that.guru>

Thanks. Applied and included in the new 2.1.0 release.

Stephen
diff mbox series

Patch

diff --git a/man/pwclient.1 b/man/pwclient.1
index 63bf78e10442..1ff784f0a3e4 100644
--- a/man/pwclient.1
+++ b/man/pwclient.1
@@ -130,7 +130,7 @@  usage: pwclient projects [-h]
 
 
 .SH OPTIONS 'pwclient check-get'
-usage: pwclient check-get [-f FORMAT] PATCH_ID
+usage: pwclient check-get [--help] [-h] [-p PROJECT] [-f FORMAT] PATCH_ID [PATCH_ID ...]
 
 .TP
 \fBPATCH_ID\fR
diff --git a/pwclient/parser.py b/pwclient/parser.py
index 54c9bdd22ff7..1efedd233766 100644
--- a/pwclient/parser.py
+++ b/pwclient/parser.py
@@ -112,12 +112,9 @@  installed locales.
     projects_parser.set_defaults(subcmd='projects')
 
     check_get_parser = subparsers.add_parser(
-        'check-get', add_help=False,
+        'check-get', parents=[hash_parser], conflict_handler='resolve',
         help="get checks for a patch"
     )
-    check_get_parser.add_argument(
-        'patch_id', metavar='PATCH_ID', action='store', type=int,
-        help="patch ID")
     check_get_parser.add_argument(
         '-f', '--format', metavar='FORMAT',
         help=("print output in the given format. You can use tags matching "
diff --git a/pwclient/shell.py b/pwclient/shell.py
index 02165badcfa8..762836c3c417 100644
--- a/pwclient/shell.py
+++ b/pwclient/shell.py
@@ -212,9 +212,9 @@  def main(argv=sys.argv[1:]):
                 commit=args.commit_ref)
 
     elif action == 'check_get':
-        patch_id = args.patch_id
         format_str = args.format
-        checks.action_get(rpc, patch_id, format_str)
+        for patch_id in patch_ids:
+            checks.action_get(rpc, patch_id, format_str)
 
     elif action == 'check_list':
         checks.action_list(rpc)