Feature Request: rule.tags
See original GitHub issueIs your feature request related to a problem? Please describe.
I’d like to keep all my rules in one file (easier to maintain, and you know they will be run sequentially) I’d also like to run a subset of rules on occasion, rather than all of them, or likewise exclude certain groups of rules.
Describe the solution you’d like One solution would be to allow rules to have one or more ‘tags’
- name: "Test rule"
locations:
- ~/Downloads
filters:
- extension: pdf
actions:
- shell: '~/bin/organize-pdf-handler "{path}"'
tags:
- home
- nas_mounted
Then you could run a subset of rules…
organize run --include-tags home
Or exclude some
organize run --exclude-tags nas_mounted
Describe alternatives you’ve considered Maintaining seperate config files for the various scenarios. It would be complex and difficult to maintain, and probably require duplicated rules.
Additional context I’d also like to explore hooking organize up to inotify, in which case it would be useful to handle an inotify event and then trigger just the revelant rules, without running the entire ruleset.
Great tool by the way, thanks
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
v2.2.0 is out and includes tag support 🎉
Tagging your rules works like you described in your request. Then use the command line parameters
--tags=foo,bar
and--skip-tags=slow
.Documentation
I think that would be really useful 👍 There is no way to run only certain tasks at the moment. This certainly goes on the todo list!