From 89245def44ce5d2f7fbf665155b42794484c507d Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Tue, 26 Apr 2016 20:07:50 +0000 Subject: Convert RP utilities to use common config/argparse/logging setup. svn path=/branches/tk705/; revision=6392 --- rp/utils/print_roa | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'rp/utils/print_roa') diff --git a/rp/utils/print_roa b/rp/utils/print_roa index dd13447d..c5b7793a 100755 --- a/rp/utils/print_roa +++ b/rp/utils/print_roa @@ -21,7 +21,7 @@ Pretty-print the content of a ROA. Does NOT attempt to verify the signature. """ -import argparse +import rpki.config import rpki.POW class ROA(rpki.POW.ROA): # pylint: disable=W0232 @@ -42,12 +42,12 @@ class ROA(rpki.POW.ROA): # pylint: disable=W0232 self.v4_prefixes = [self._format_prefix(p) for p in (v4 or ())] self.v6_prefixes = [self._format_prefix(p) for p in (v6 or ())] -parser = argparse.ArgumentParser(description = __doc__) -parser.add_argument("-b", "--brief", action = "store_true", help = "show only ASN and prefix(es)") -parser.add_argument("-c", "--cms", action = "store_true", help = "print text representation of entire CMS blob") -parser.add_argument("-s", "--signing-time", action = "store_true", help = "show SigningTime in brief mode") -parser.add_argument("roas", nargs = "+", type = ROA.derReadFile, help = "ROA(s) to print") # pylint: disable=E1101 -args = parser.parse_args() +cfg = rpki.config.argparser(doc = __doc__) +cfg.argparser.add_argument("--brief", action = "store_true", help = "show only ASN and prefix(es)") +cfg.argparser.add_argument("--cms", action = "store_true", help = "print text representation of entire CMS blob") +cfg.argparser.add_argument("--signing-time", action = "store_true", help = "show SigningTime in brief mode") +cfg.argparser.add_argument("roas", nargs = "+", type = ROA.derReadFile, help = "ROA(s) to print") # pylint: disable=E1101 +args = cfg.argparser.parse_args() for roa in args.roas: roa.parse() -- cgit v1.2.3