Skip to content

Commit 7c38ef6

Browse files
author
Gauvain Pocentek
committed
python3: fix CLI error when arguments are missing
1 parent 1db3cc1 commit 7c38ef6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

gitlab/cli.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,9 @@ def main():
246246
"will be used."),
247247
required=False)
248248

249-
subparsers = parser.add_subparsers(dest='what')
249+
subparsers = parser.add_subparsers(title='object', dest='what',
250+
help="Object to manipulate.")
251+
subparsers.required = True
250252

251253
# populate argparse for all Gitlab Object
252254
classes = []
@@ -262,8 +264,10 @@ def main():
262264
arg_name = clsToWhat(cls)
263265
object_group = subparsers.add_parser(arg_name)
264266

265-
object_subparsers = object_group.add_subparsers(dest='action')
267+
object_subparsers = object_group.add_subparsers(
268+
dest='action', help="Action to execute.")
266269
populate_sub_parser_by_class(cls, object_subparsers)
270+
object_subparsers.required = True
267271

268272
arg = parser.parse_args()
269273
args = arg.__dict__

0 commit comments

Comments
 (0)