From bb450e0a353c3f4c13a9c198dd25018713996472 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 9 Apr 2017 13:01:08 +0100 Subject: [PATCH] hippotatd: support --print-config Signed-off-by: Ian Jackson --- hippotatd | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hippotatd b/hippotatd index e3e42fb..a235929 100755 --- a/hippotatd +++ b/hippotatd @@ -326,6 +326,12 @@ def process_cfg(_opts, putative_servers, putative_clients): ('peer', 'vrelay'), ('rnets','vnetwork'))) + if opts.printconfig is not None: + try: val = cfg.get(c.server, opts.printconfig) + except NoOptionError: pass + else: print(val) + sys.exit(0) + def catch_termination(): def run_cleanups(): for cleanup in cleanups: @@ -446,6 +452,12 @@ optparser.add_option('--syslog-facility', default=None, help='log to syslog, with specified facility') +optparser.add_option('--print-config', + nargs=1, type='string',action='store', + metavar='OPTION', dest='printconfig', + default=None, + help='print one config option value and exit') + common_startup(process_cfg) catch_termination() start_http() -- 2.11.0