diff options
Diffstat (limited to 'rp/utils/print_roa')
-rwxr-xr-x | rp/utils/print_roa | 14 |
1 files changed, 7 insertions, 7 deletions
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() |