From 79c9c0747e876c0b97a4fb3fe91fa9825e462722 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 15 Nov 2020 16:25:57 +0100 Subject: Add a dry run mode. --- dotbot/cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'dotbot/cli.py') diff --git a/dotbot/cli.py b/dotbot/cli.py index 0795d40..b09461e 100644 --- a/dotbot/cli.py +++ b/dotbot/cli.py @@ -18,6 +18,8 @@ def add_options(parser): help='suppress most output') parser.add_argument('-v', '--verbose', action='store_true', help='enable verbose output') + parser.add_argument('-n', '--dry-run', action='store_true', + help='do not actually perform any changes') parser.add_argument('-d', '--base-directory', help='execute commands from within BASEDIR', metavar='BASEDIR') @@ -97,7 +99,8 @@ def main(): # default to directory of config file base_directory = os.path.dirname(os.path.abspath(options.config_file)) os.chdir(base_directory) - dispatcher = Dispatcher(base_directory, only=options.only, skip=options.skip) + dispatcher = Dispatcher(base_directory, only=options.only, skip=options.skip, + dry_run = options.dry_run) success = dispatcher.dispatch(tasks) if success: log.verbose('\n==> All tasks executed successfully') -- cgit v1.2.3