aboutsummaryrefslogtreecommitdiff
path: root/rpki/config.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-04-03 00:58:52 +0000
committerRob Austein <sra@hactrn.net>2016-04-03 00:58:52 +0000
commita65c4cf08d701a698895847645d1582ebe1a7044 (patch)
tree407f8d808cf113dbef73cfdb8c79cc3d220ac35c /rpki/config.py
parent5966fae58e2f3bfb226dec71477adb1d96baf5d5 (diff)
Move more programs to integrated config+argparse framework.
svn path=/branches/tk705/; revision=6346
Diffstat (limited to 'rpki/config.py')
-rw-r--r--rpki/config.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/rpki/config.py b/rpki/config.py
index 7550c8f4..1aea0132 100644
--- a/rpki/config.py
+++ b/rpki/config.py
@@ -254,6 +254,7 @@ class parser(object):
section = kwargs.pop("section", None)
default = kwargs.pop("default", None)
+ help = kwargs.pop("help", None)
if not name.startswith("--"):
raise ValueError
@@ -270,7 +271,7 @@ class parser(object):
group.add_argument("--" + name, **kwargs)
kwargs["const"] = False
- #kwargs["help"] = argparse.SUPPRESS
+ kwargs["help"] = help
group.add_argument("--no-" + name, **kwargs)
self.argparser.set_defaults(**{ kwargs["dest"] : default })
@@ -370,13 +371,13 @@ def argparser(section = None, doc = None, cfg_optional = False):
# drop-in, and should reduce the amount of repetitive code. There
# are a couple of special cases which will require attention:
#
- # - rpki.rtr: These modules have their own handling of all the
- # logging setup, and use an argparse subparser. I -think- that
- # the way they're already handling the logging setup should work
- # fine, but there may be a few tricky bits reconciling this code
- # with the more generalized version in rpki.log.
+ # - rpki.rtr: The rpki-rtr modules have their own handling of all
+ # the logging setup, and use an argparse subparser. I -think-
+ # that the way they're already handling the logging setup should
+ # work fine, but there may be a few tricky bits reconciling the
+ # rpki-rtr logging setup with the generalized version in rpki.log.
#
- # - rpki.rpkic: Use of argparse here is very complicated due to
+ # - rpki.rpkic: Use of argparse in rpkic is very complicated due to
# support for both the external command line and the internal
# command loop. Overall it works quite well, but the setup is
# tricky. rpki.rpkic.main.top_argparse may need to move outside
@@ -410,4 +411,4 @@ def argparser(section = None, doc = None, cfg_optional = False):
argparser = argparser,
allow_missing = cfg_optional or args.help)
- return cfg, argparser
+ return cfg