]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
Fix unexpected output on exec alembic command without a subcommand.
authorAndrei Antoukh <niwi@niwi.be>
Sun, 10 Feb 2013 11:55:23 +0000 (12:55 +0100)
committerAndrei Antoukh <niwi@niwi.be>
Sun, 10 Feb 2013 11:55:23 +0000 (12:55 +0100)
alembic/config.py

index 8c25aeaa5910848569aa07074d3f1ee449a2edba..1b3b3413b52285e350bc6fc860a3433757d9a359 100644 (file)
@@ -245,9 +245,11 @@ class CommandLine(object):
 
     def main(self, argv=None):
         options = self.parser.parse_args(argv)
-
-        cfg = Config(options.config, options.name)
-        self.run_cmd(cfg, options)
+        if not hasattr(options, "cmd"):
+            self.parser.print_help()
+        else:
+            cfg = Config(options.config, options.name)
+            self.run_cmd(cfg, options)
 
 def main(argv=None, prog=None, **kwargs):
     """The console runner function for Alembic."""