From 25fc65a52f2a09c1c6a5d62940621d3286881704 Mon Sep 17 00:00:00 2001 From: "klimenko.as" Date: Mon, 9 May 2022 08:29:26 -0700 Subject: [PATCH] fix(cli): changed default `allow_abbrev` value to fix arguments collision problem The `--job` argument could be interpreted as `--job-token` Example failure: $ gitlab \ --private-token ${GITLAB_API_KEY} -o json \ project-artifact download \ --project-id mdm/entities \ --job ${JOB} \ --ref-name ${REF} \ gitlab: error: argument --job-token: not allowed with argument --private-token --- gitlab/cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gitlab/cli.py b/gitlab/cli.py index f06f49d94..cad6b6fd5 100644 --- a/gitlab/cli.py +++ b/gitlab/cli.py @@ -106,7 +106,9 @@ def cls_to_what(cls: RESTObject) -> str: def _get_base_parser(add_help: bool = True) -> argparse.ArgumentParser: parser = argparse.ArgumentParser( - add_help=add_help, description="GitLab API Command Line Interface" + add_help=add_help, + description="GitLab API Command Line Interface", + allow_abbrev=False, ) parser.add_argument("--version", help="Display the version.", action="store_true") parser.add_argument(