summaryrefslogtreecommitdiff
path: root/tools/mergetools.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mergetools.py')
-rw-r--r--tools/mergetools.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/tools/mergetools.py b/tools/mergetools.py
index 0afec24..62b11e4 100644
--- a/tools/mergetools.py
+++ b/tools/mergetools.py
@@ -417,17 +417,18 @@ def get_missingentriesforbackup(node, baseurl, own_key, paths):
def chunks(l, n):
return [l[i:i+n] for i in range(0, len(l), n)]
-def parse_args():
- parser = argparse.ArgumentParser(description="")
- parser.add_argument('node', nargs='*', help="Node to operate on")
- parser.add_argument('--config', help="System configuration",
- required=True)
- parser.add_argument('--localconfig', help="Local configuration",
- required=True)
- parser.add_argument('--interval', type=int, metavar="n",
- help="Repeate every N seconds")
- parser.add_argument("--timing", action='store_true',
- help="Print timing information")
+def parse_args(parser=None):
+ if parser == None:
+ parser = argparse.ArgumentParser(description="")
+ parser.add_argument('node', nargs='*', help="Node to operate on")
+ parser.add_argument('--config', help="System configuration",
+ required=True)
+ parser.add_argument('--localconfig', help="Local configuration",
+ required=True)
+ parser.add_argument('--interval', type=int, metavar="n",
+ help="Repeate every N seconds")
+ parser.add_argument("--timing", action='store_true',
+ help="Print timing information")
args = parser.parse_args()
localconfig = readconfig.read_config(args.localconfig)