Skip to content

Commit 6d97612

Browse files
m-aciekJulienPalard
authored andcommitted
Provide allowed choices for branch CLI argument
Set metavar to most recent version
1 parent 85b9d5a commit 6d97612

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

build_docs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from contextlib import suppress
2424
from dataclasses import dataclass
2525
import filecmp
26-
from itertools import product
26+
from itertools import chain, product
2727
import json
2828
import logging
2929
import logging.handlers
@@ -595,7 +595,8 @@ def parse_args():
595595
parser.add_argument(
596596
"-b",
597597
"--branch",
598-
metavar="3.6",
598+
choices=dict.fromkeys(chain(*((v.branch_or_tag, v.name) for v in VERSIONS))),
599+
metavar=Version.current_dev().name,
599600
help="Version to build (defaults to all maintained branches).",
600601
)
601602
parser.add_argument(

0 commit comments

Comments
 (0)