Skip to content

Commit a8caddc

Browse files
author
Hakan Fouren
committed
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
1 parent 1792442 commit a8caddc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gitlab/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,6 @@ def main():
136136
exit(0)
137137

138138
parser = _get_base_parser(add_help=False)
139-
if "--help" in sys.argv or "-h" in sys.argv:
140-
parser.print_help()
141-
exit(0)
142139

143140
# This first parsing step is used to find the gitlab config to use, and
144141
# load the propermodule (v3 or v4) accordingly. At that point we don't have
@@ -150,6 +147,9 @@ def main():
150147
options.config_file
151148
)
152149
except gitlab.config.ConfigError as e:
150+
if "--help" in sys.argv or "-h" in sys.argv:
151+
parser.print_help()
152+
exit(0)
153153
sys.exit(e)
154154
cli_module = importlib.import_module('gitlab.v%s.cli' % config.api_version)
155155

0 commit comments

Comments
 (0)