From: Andrei Antoukh Date: Sun, 10 Feb 2013 11:55:23 +0000 (+0100) Subject: Fix unexpected output on exec alembic command without a subcommand. X-Git-Tag: rel_0_5_0~23^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c14b6445735b3e3f22f351c3af6ece87179d568;p=thirdparty%2Fsqlalchemy%2Falembic.git Fix unexpected output on exec alembic command without a subcommand. --- diff --git a/alembic/config.py b/alembic/config.py index 8c25aeaa..1b3b3413 100644 --- a/alembic/config.py +++ b/alembic/config.py @@ -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."""