]> Git Repo - u-boot.git/commitdiff
tools: efivar.py without arguments
authorHeinrich Schuchardt <[email protected]>
Sat, 9 Jan 2021 00:52:30 +0000 (01:52 +0100)
committerHeinrich Schuchardt <[email protected]>
Wed, 13 Jan 2021 01:38:00 +0000 (02:38 +0100)
When tools: efivar.py is called without arguments an error occurs:

Traceback (most recent call last):
  File "tools/efivar.py", line 380, in <module>
    main()
  File "tools/efivar.py", line 360, in main
    args.func(args)
AttributeError: 'Namespace' object has no attribute 'func'

Show the online help if the arguments do not specify a function.

Signed-off-by: Heinrich Schuchardt <[email protected]>
Reviewed-by: Paulo Alcantara (SUSE) <[email protected]>
tools/efivar.py

index ebfcab2f0a2c3ec08e58b6fc939335ee71f7213e..c40a0fa6c7d1bc4811dc2e420c08d44f3a13392a 100755 (executable)
@@ -357,7 +357,10 @@ def main():
     signp.set_defaults(func=cmd_sign)
 
     args = ap.parse_args()
-    args.func(args)
+    if hasattr(args, "func"):
+        args.func(args)
+    else:
+        ap.print_help()
 
 def group(a, *ns):
     for n in ns:
This page took 0.034894 seconds and 4 git commands to generate.