[PATCH v2 12/13] scripts/ghes_inject: print help if no command specified

Mauro Carvalho Chehab posted 13 patches 1 day, 20 hours ago
Maintainers: John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>, Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
[PATCH v2 12/13] scripts/ghes_inject: print help if no command specified
Posted by Mauro Carvalho Chehab 1 day, 20 hours ago
The first positional argument (command) is mandatory. If not
specified, instead of a simple error message, show help as well.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 scripts/ghes_inject.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/ghes_inject.py b/scripts/ghes_inject.py
index 63a8b28002e7..dd2b34a64f15 100755
--- a/scripts/ghes_inject.py
+++ b/scripts/ghes_inject.py
@@ -52,6 +52,9 @@ def main():
         if not args.func(args):
             sys.exit(1)
     else:
+        print("Error: no command specified\n", file=sys.stderr)
+        parser.print_help(file=sys.stderr)
+        print(file=sys.stderr)
         sys.exit(f"Please specify a valid command for {sys.argv[0]}")
 
 if __name__ == "__main__":
-- 
2.52.0
Re: [PATCH v2 12/13] scripts/ghes_inject: print help if no command specified
Posted by Jonathan Cameron via qemu development 1 day, 17 hours ago
On Fri, 23 Jan 2026 14:35:26 +0100
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> wrote:

> The first positional argument (command) is mandatory. If not
> specified, instead of a simple error message, show help as well.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Seems unchanged so still...
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>