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/hashdir | |
parent | 2e0f5147b3099b6b584ec302be7f0818aad969f0 (diff) |
Convert RP utilities to use common config/argparse/logging setup.
svn path=/branches/tk705/; revision=6392
Diffstat (limited to 'rp/utils/hashdir')
-rwxr-xr-x | rp/utils/hashdir | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/rp/utils/hashdir b/rp/utils/hashdir index 21619ce4..c2c100b8 100755 --- a/rp/utils/hashdir +++ b/rp/utils/hashdir @@ -26,7 +26,7 @@ distributed as part of the repository system. import os import sys -import argparse +import rpki.config from rpki.rcynicdb.iterator import authenticated_objects @@ -36,11 +36,11 @@ def check_dir(s): else: raise argparse.ArgumentTypeError("{!r} is not a directory".format(s)) -parser = argparse.ArgumentParser(description = __doc__) -parser.add_argument("-v", "--verbose", action = "store_true", help = "whistle while you work") -parser.add_argument("rcynic_dir", nargs = "?", type = check_dir, help = "rcynic authenticated output directory") -parser.add_argument("output_dir", help = "name of output directory to create") -args = parser.parse_args() +cfg = rpki.config.argparser(doc = __doc__) +cfg.argparser.add_argument("-v", "--verbose", action = "store_true", help = "whistle while you work") +cfg.argparser.add_argument("rcynic_dir", nargs = "?", type = check_dir, help = "rcynic authenticated output directory") +cfg.argparser.add_argument("output_dir", help = "name of output directory to create") +args = cfg.argparser.parse_args() if not os.path.isdir(args.output_dir): os.makedirs(args.output_dir) |