summaryrefslogtreecommitdiff
path: root/example.py
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-10-18 15:02:44 +0200
committerAnton Khirnov <anton@khirnov.net>2020-10-18 16:17:35 +0200
commit89a67fdb3fb28c88aaa0abdedbff080c06f78c4e (patch)
tree803bbcd75f3558e4bc60eb849220bc41042a8f64 /example.py
parentfbb0edad8fc713b10e8649444497ef67db37e9ad (diff)
Add a dry-run option.
Diffstat (limited to 'example.py')
-rwxr-xr-xexample.py3
1 files changed, 2 insertions, 1 deletions
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