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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26143>
This commit is contained in:
Eric Engestrom 2023-11-06 18:10:57 +00:00 committed by Marge Bot
parent 08f851f436
commit c6ef161bc1

View File

@ -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(