diff options
author | Gauvain Pocentek <gauvain.pocentek@objectif-libre.com> | 2015-12-31 07:31:50 +0100 |
---|---|---|
committer | Gauvain Pocentek <gauvain.pocentek@objectif-libre.com> | 2015-12-31 07:31:50 +0100 |
commit | 7c38ef6f2f089c1fbf9fa0ade249bb460c96ee9d (patch) | |
tree | 92ccfcb4027d29468edaaeaa69ec25b928bf7c09 /gitlab/cli.py | |
parent | 1db3cc1e4f7e8f3bfae1f2e8cdbd377701789eb4 (diff) | |
download | gitlab-7c38ef6f2f089c1fbf9fa0ade249bb460c96ee9d.tar.gz |
python3: fix CLI error when arguments are missing
Diffstat (limited to 'gitlab/cli.py')
-rw-r--r-- | gitlab/cli.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gitlab/cli.py b/gitlab/cli.py index 2874a5f..1b8356c 100644 --- a/gitlab/cli.py +++ b/gitlab/cli.py @@ -246,7 +246,9 @@ def main(): "will be used."), required=False) - subparsers = parser.add_subparsers(dest='what') + subparsers = parser.add_subparsers(title='object', dest='what', + help="Object to manipulate.") + subparsers.required = True # populate argparse for all Gitlab Object classes = [] @@ -262,8 +264,10 @@ def main(): arg_name = clsToWhat(cls) object_group = subparsers.add_parser(arg_name) - object_subparsers = object_group.add_subparsers(dest='action') + object_subparsers = object_group.add_subparsers( + dest='action', help="Action to execute.") populate_sub_parser_by_class(cls, object_subparsers) + object_subparsers.required = True arg = parser.parse_args() args = arg.__dict__ |