gendoc.py: add --list_targets arg
I want to be able to run all of the targets except one from matrix-doc, so make a way to list the targets.
This commit is contained in:
parent
69c2eb7edb
commit
8b61dab1c6
1 changed files with 17 additions and 0 deletions
|
@ -441,6 +441,13 @@ def main(targets, keep_intermediates, substitutions):
|
||||||
cleanup_env()
|
cleanup_env()
|
||||||
|
|
||||||
|
|
||||||
|
def list_targets():
|
||||||
|
with open("../specification/targets.yaml", "r") as targ_file:
|
||||||
|
target_defs = yaml.load(targ_file.read())
|
||||||
|
targets = target_defs["targets"].keys() + ["howtos"]
|
||||||
|
print "\n".join(targets)
|
||||||
|
|
||||||
|
|
||||||
def extract_major(s):
|
def extract_major(s):
|
||||||
major_version = s
|
major_version = s
|
||||||
match = re.match("^(r\d)+(\.\d+)*$", s)
|
match = re.match("^(r\d)+(\.\d+)*$", s)
|
||||||
|
@ -474,8 +481,18 @@ if __name__ == '__main__':
|
||||||
"--server_release", "-s", action="store", default="unstable",
|
"--server_release", "-s", action="store", default="unstable",
|
||||||
help="The server-server release tag to generate, e.g. r1.2"
|
help="The server-server release tag to generate, e.g. r1.2"
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--list_targets", action="store_true",
|
||||||
|
help="Do not update the specification. Instead print a list of targets.",
|
||||||
|
)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
VERBOSE = args.verbose
|
VERBOSE = args.verbose
|
||||||
|
|
||||||
|
if args.list_targets:
|
||||||
|
list_targets()
|
||||||
|
exit(0)
|
||||||
|
|
||||||
substitutions = {
|
substitutions = {
|
||||||
"%CLIENT_RELEASE_LABEL%": args.client_release,
|
"%CLIENT_RELEASE_LABEL%": args.client_release,
|
||||||
"%CLIENT_MAJOR_VERSION%": extract_major(args.client_release),
|
"%CLIENT_MAJOR_VERSION%": extract_major(args.client_release),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue