From e884a457a0b963625946daa14bbaf89c793c4eb3 Mon Sep 17 00:00:00 2001 From: Build Team Date: Fri, 10 May 2024 13:07:22 +0100 Subject: [PATCH] Handle case with no arguments --- okonomiyaki/_cli/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/okonomiyaki/_cli/__init__.py b/okonomiyaki/_cli/__init__.py index 77b1344f..7d436355 100644 --- a/okonomiyaki/_cli/__init__.py +++ b/okonomiyaki/_cli/__init__.py @@ -106,4 +106,7 @@ def main(argv=None): index_p.set_defaults(func=show_index) ns = p.parse_args(argv) - ns.func(ns) + if hasattr(ns, 'func'): + ns.func(ns) + else: + p.print_help()