From 89a67fdb3fb28c88aaa0abdedbff080c06f78c4e Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 18 Oct 2020 15:02:44 +0200 Subject: Add a dry-run option. --- example.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'example.py') diff --git a/example.py b/example.py index 1643a17..62e237f 100755 --- a/example.py +++ b/example.py @@ -20,6 +20,7 @@ def list_targets(tgts): # parse the commandline parser = argparse.ArgumentParser() parser.add_argument('-l', '--list-targets', action = 'store_true') +parser.add_argument('-n', '--dry-run', action = 'store_true') parser.add_argument('targets', nargs = argparse.REMAINDER) args = parser.parse_args() @@ -41,7 +42,7 @@ else: tgts_run = tgts repo = Repo() -res = repo.backup(tgts_run) +res = repo.backup(tgts_run, dry_run = args.dry_run) for tgt, tgt_res in res.target_results.items(): if tgt_res.success: continue -- cgit v1.2.3