Skip to content

Commit

Permalink
gendoc.py: add --list_targets arg
Browse files Browse the repository at this point in the history
I want to be able to run all of the targets except one from matrix-doc, so make
a way to list the targets.
  • Loading branch information
richvdh committed May 9, 2016
1 parent 69c2eb7 commit 8b61dab
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scripts/gendoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,13 @@ def main(targets, keep_intermediates, substitutions):
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):
major_version = s
match = re.match("^(r\d)+(\.\d+)*$", s)
Expand Down Expand Up @@ -474,8 +481,18 @@ def extract_major(s):
"--server_release", "-s", action="store", default="unstable",
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()
VERBOSE = args.verbose

if args.list_targets:
list_targets()
exit(0)

substitutions = {
"%CLIENT_RELEASE_LABEL%": args.client_release,
"%CLIENT_MAJOR_VERSION%": extract_major(args.client_release),
Expand Down

0 comments on commit 8b61dab

Please sign in to comment.