fix default gmg help message
authorBoris Bobrov <breton@cynicmansion.ru>
Wed, 11 Jul 2018 14:53:32 +0000 (16:53 +0200)
committerBoris Bobrov <breton@cynicmansion.ru>
Wed, 11 Jul 2018 14:53:32 +0000 (16:53 +0200)
mediagoblin/gmg_commands/__init__.py

index 98b097a625e5a612266a2e4e3fae7f81121b64d1..0034fd98852133e6b05ad68867786ba494489986 100644 (file)
@@ -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__':