Skip to content

Commit a6e10f9

Browse files
authored
Merge pull request #732 from hakanf/master
Re-enable command specific help messages
2 parents bc973d4 + 6fe2988 commit a6e10f9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

gitlab/cli.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,9 @@ def _parse_value(v):
133133
def main():
134134
if "--version" in sys.argv:
135135
print(gitlab.__version__)
136-
exit(0)
136+
sys.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+
sys.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)