diff options
author | Hakan Fouren <hakan@vilynx.com> | 2019-03-06 01:17:56 +0800 |
---|---|---|
committer | Hakan Fouren <hakan@vilynx.com> | 2019-03-06 01:17:56 +0800 |
commit | a8caddcb1e193c5472f5521dee0e18b1af32c89b (patch) | |
tree | efd1d4a563fb5b03aae1b77de289b0ff5d38a877 /gitlab/cli.py | |
parent | 17924424e5112f5c4b3de16e46856794dea3509b (diff) | |
download | gitlab-a8caddcb1e193c5472f5521dee0e18b1af32c89b.tar.gz |
Re-enable command specific help mesaages
This makes sure that the global help message wont be printed instead of the command spedific one unless we fail to read the configuration file
Diffstat (limited to 'gitlab/cli.py')
-rw-r--r-- | gitlab/cli.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gitlab/cli.py b/gitlab/cli.py index 17917f5..5ca4568 100644 --- a/gitlab/cli.py +++ b/gitlab/cli.py @@ -136,9 +136,6 @@ def main(): exit(0) parser = _get_base_parser(add_help=False) - if "--help" in sys.argv or "-h" in sys.argv: - parser.print_help() - exit(0) # This first parsing step is used to find the gitlab config to use, and # load the propermodule (v3 or v4) accordingly. At that point we don't have @@ -150,6 +147,9 @@ def main(): options.config_file ) except gitlab.config.ConfigError as e: + if "--help" in sys.argv or "-h" in sys.argv: + parser.print_help() + exit(0) sys.exit(e) cli_module = importlib.import_module('gitlab.v%s.cli' % config.api_version) |