diff options
Diffstat (limited to 'dotbot/dispatcher.py')
-rw-r--r-- | dotbot/dispatcher.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/dotbot/dispatcher.py b/dotbot/dispatcher.py index 36eac02..10e4293 100644 --- a/dotbot/dispatcher.py +++ b/dotbot/dispatcher.py @@ -4,10 +4,12 @@ from .messenger import Messenger from .context import Context class Dispatcher(object): - def __init__(self, base_directory): + def __init__(self, base_directory, only=None, skip=None): self._log = Messenger() self._setup_context(base_directory) self._load_plugins() + self._only = only + self._skip = skip def _setup_context(self, base_directory): path = os.path.abspath( @@ -20,6 +22,10 @@ class Dispatcher(object): success = True for task in tasks: for action in task: + if self._only is not None and action not in self._only \ + or self._skip is not None and action in self._skip: + self._log.info('Skipping action %s' % action) + continue handled = False if action == 'defaults': self._context.set_defaults(task[action]) # replace, not update |