diff options
author | Rob Austein <sra@hactrn.net> | 2016-04-26 20:07:50 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2016-04-26 20:07:50 +0000 |
commit | 89245def44ce5d2f7fbf665155b42794484c507d (patch) | |
tree | 862fb232cf7badd11b3bcd75a11d52c4c8e40690 /rp/utils/find_roa | |
parent | 2e0f5147b3099b6b584ec302be7f0818aad969f0 (diff) |
Convert RP utilities to use common config/argparse/logging setup.
svn path=/branches/tk705/; revision=6392
Diffstat (limited to 'rp/utils/find_roa')
-rwxr-xr-x | rp/utils/find_roa | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/rp/utils/find_roa b/rp/utils/find_roa index 8b962d9c..9a387c6a 100755 --- a/rp/utils/find_roa +++ b/rp/utils/find_roa @@ -25,6 +25,7 @@ import os import argparse import rpki.POW import rpki.oids +import rpki.config def check_dir(s): @@ -135,15 +136,15 @@ class ROA(rpki.POW.ROA): # pylint: disable=W0232 print -parser = argparse.ArgumentParser(description = __doc__) -parser.add_argument("-a", "--all", action = "store_true", help = "show all ROAs, do no prefix matching at all") -parser.add_argument("-m", "--match-maxlength", action = "store_true", help = "pay attention to maxLength values") -parser.add_argument("-e", "--show-expiration", action = "store_true", help = "show ROA chain expiration dates") -parser.add_argument("-f", "--show-filenames", action = "store_true", help = "show filenames instead of URIs") -parser.add_argument("-i", "--show-inception", action = "store_true", help = "show inception dates") -parser.add_argument("rcynic_dir", type = check_dir, help = "rcynic authenticated output directory") -parser.add_argument("prefixes", type = Prefix, nargs = "*", help = "ROA prefix(es) to match") -args = parser.parse_args() +cfg = rpki.config.argparser(doc = __doc__) +cfg.argparser.add_argument("-a", "--all", action = "store_true", help = "show all ROAs, do no prefix matching at all") +cfg.argparser.add_argument("-m", "--match-maxlength", action = "store_true", help = "pay attention to maxLength values") +cfg.argparser.add_argument("-e", "--show-expiration", action = "store_true", help = "show ROA chain expiration dates") +cfg.argparser.add_argument("-f", "--show-filenames", action = "store_true", help = "show filenames instead of URIs") +cfg.argparser.add_argument("-i", "--show-inception", action = "store_true", help = "show inception dates") +cfg.argparser.add_argument("rcynic_dir", type = check_dir, help = "rcynic authenticated output directory") +cfg.argparser.add_argument("prefixes", type = Prefix, nargs = "*", help = "ROA prefix(es) to match") +args = cfg.argparser.parse_args() # If there's some way to automate this in the parser, I don't know what it is, so just catch it here. if args.all != (not args.prefixes): |