summaryrefslogtreecommitdiff
path: root/dotbot/cli.py
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-11-15 16:25:57 +0100
committerAnton Khirnov <anton@khirnov.net>2020-11-15 16:25:57 +0100
commit79c9c0747e876c0b97a4fb3fe91fa9825e462722 (patch)
treeff298dd32dfccfde9921d0ac2c48bc36113a55c6 /dotbot/cli.py
parent5ffd208bdb85215cc7c5ba6f2903bfa7756aa945 (diff)
Add a dry run mode.
Diffstat (limited to 'dotbot/cli.py')
-rw-r--r--dotbot/cli.py5
1 files changed, 4 insertions, 1 deletions
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')