diff options
Diffstat (limited to 'tools/compileconfig.py')
-rwxr-xr-x | tools/compileconfig.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/compileconfig.py b/tools/compileconfig.py index 87d46c6..35ecb91 100755 --- a/tools/compileconfig.py +++ b/tools/compileconfig.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright (c) 2014-2016, NORDUnet A/S. +# Copyright (c) 2014-2017, NORDUnet A/S. # See LICENSE for licensing information. import argparse @@ -9,6 +9,7 @@ import readconfig import re import base64 from datetime import datetime +import manpage class Symbol(str): pass @@ -561,6 +562,10 @@ def printnodenames(config): print " ".join(frontendnodenames|storagenodenames|signingnodenames|mergenodenames|statusservernodenames) +def gen_manpage(manpagedir): + manpage.rewrite_manpage(manpagedir + "/catlfish-log.cfg.in.5.adoc", globalconfigschema, "Catlfish", "Catlfish Manual", "CATLFISH-LOG.CFG.IN(5)", "catlfish-log.cfg.in - catlfish log configuration") + manpage.rewrite_manpage(manpagedir + "/catlfish-node.cfg.5.adoc", localconfigschema, "Catlfish", "Catlfish Manual", "CATLFISH-NODE.CFG(5)", "catlfish-node.cfg - catlfish node configuration") + localconfigschema = [ ("nodename", "string", "nodename"), ("frontendaddress", "string", "ip address"), @@ -623,14 +628,19 @@ globalconfigschema = [ def main(): parser = argparse.ArgumentParser(description="") parser.add_argument('--config', help="System configuration") + parser.add_argument("--manpagedir", metavar="file", help="Generate manpages to directory") parser.add_argument('--localconfig', help="Local configuration") parser.add_argument("--testmakefile", metavar="file", help="Generate makefile variables for test") parser.add_argument("--testshellvars", metavar="file", help="Generate shell variable file for test") parser.add_argument("--getnodenames", action='store_true', help="Get list of node names") args = parser.parse_args() + if args.manpagedir: + gen_manpage(args.manpagedir) + sys.exit(0) + if not args.config: - print >>sys.stderr, "--config is required" + print >>sys.stderr, "either --config or --manpage is required" sys.exit(1) if args.testmakefile: |