diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-10-18 15:02:44 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-10-18 16:17:35 +0200 |
commit | 89a67fdb3fb28c88aaa0abdedbff080c06f78c4e (patch) | |
tree | 803bbcd75f3558e4bc60eb849220bc41042a8f64 /example.py | |
parent | fbb0edad8fc713b10e8649444497ef67db37e9ad (diff) |
Add a dry-run option.
Diffstat (limited to 'example.py')
-rwxr-xr-x | example.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 |