From c6ef161bc14894b0622a659e73893e997c61dd47 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Mon, 6 Nov 2023 18:10:57 +0000 Subject: [PATCH] bin/gitlab_gql: only allow a single `--print-*` argument per invocation Printing multiple things as the same time is not really usable, so let's be explicit and only allow one at a time, which allows a few cleanups in the code. Part-of: --- bin/ci/gitlab_gql.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/ci/gitlab_gql.py b/bin/ci/gitlab_gql.py index f4c76a947fc..211f9bc3ee2 100755 --- a/bin/ci/gitlab_gql.py +++ b/bin/ci/gitlab_gql.py @@ -482,13 +482,18 @@ def parse_args() -> Namespace: required=False, help="Regex pattern for the job name to be considered", ) - parser.add_argument("--print-dag", action="store_true", help="Print job needs DAG") - parser.add_argument( + mutex_group_print = parser.add_mutually_exclusive_group() + mutex_group_print.add_argument( + "--print-dag", + action="store_true", + help="Print job needs DAG", + ) + mutex_group_print.add_argument( "--print-merged-yaml", action="store_true", help="Print the resulting YAML for the specific SHA", ) - parser.add_argument( + mutex_group_print.add_argument( "--print-job-manifest", type=str, help="Print the resulting job data" ) parser.add_argument(