From 4024bcddf9871d33ee8f528c5f6d131c4e386b2e Mon Sep 17 00:00:00 2001 From: Boris Bobrov Date: Wed, 11 Jul 2018 16:53:32 +0200 Subject: [PATCH] fix default gmg help message --- mediagoblin/gmg_commands/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mediagoblin/gmg_commands/__init__.py b/mediagoblin/gmg_commands/__init__.py index 98b097a6..0034fd98 100644 --- a/mediagoblin/gmg_commands/__init__.py +++ b/mediagoblin/gmg_commands/__init__.py @@ -145,7 +145,10 @@ def main_cli(): os.path.join(parent_directory, "mediagoblin.example.ini"), os.path.join(parent_directory, "mediagoblin.ini")) - args.func(args) + try: + args.func(args) + except AttributeError: # no subcommand or no func of subcommand + parser.print_help() if __name__ == '__main__': -- 2.25.1