summaryrefslogtreecommitdiff
path: root/tools/efivar.py
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2021-01-09 03:52:30 +0300
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2021-01-13 04:38:00 +0300
commit4f6ec7754b1342ae9f9df4524fa9fa45299f3d68 (patch)
tree00a1cb536a0de1025be3a3cf3b4f00251d31729b /tools/efivar.py
parentdb12f518edb05cbb4ea2b4f2d9771dda2341cbe7 (diff)
downloadu-boot-4f6ec7754b1342ae9f9df4524fa9fa45299f3d68.tar.xz
tools: efivar.py without arguments
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 <xypron.glpk@gmx.de> Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Diffstat (limited to 'tools/efivar.py')
-rwxr-xr-xtools/efivar.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/efivar.py b/tools/efivar.py
index ebfcab2f0a..c40a0fa6c7 100755
--- a/tools/efivar.py
+++ b/tools/efivar.py
@@ -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: