From a65c7a0a398e8cc4b95d4556c7b1bc19bd334430 Mon Sep 17 00:00:00 2001 From: Desaroll <1253183+Desaroll@users.noreply.github.com> Date: Sun, 29 Dec 2024 18:40:39 -0300 Subject: [PATCH] Show help if no argument is given Currently erroring with "AttributeError: 'Namespace' object has no attribute 'callback'" (Python 3.9.4) --- argostranslate/argospm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/argostranslate/argospm.py b/argostranslate/argospm.py index 3b39fc69..219e0c78 100644 --- a/argostranslate/argospm.py +++ b/argostranslate/argospm.py @@ -141,4 +141,7 @@ def main(): remove_parser.add_argument("name", help="Package name") args = parser.parse_args() - args.callback(args) + if(hasattr(args, "callback")): + args.callback(args) + else: + parser.print_help()