schell / steeloverseer

A file watcher and development tool.
BSD 3-Clause "New" or "Revised" License
128 stars 15 forks source link

Add -e for excluding patterns (fixes #25) #26

Closed mitchellwrosen closed 6 years ago

mitchellwrosen commented 6 years ago

Here you go sir, hope it works! Not very well tested, I just played around with it a bit at the command line, so please let me know if you find any bugs.

In summary, added -e/--exclude flag ("exclude" key is optional in the yaml file) that all get lumped together into one big regex that subtracts from every pattern.

So, this:

sos -p p1 -e e1 -c c1 -p p2 -e e2 -c2

is effectively the same this yaml file:

- pattern: p1
  excludes:
    - e1
    - e2
  commands:
    - c1
    - c2
- pattern: p2
  excludes:
    - e1
    - e2
  commands:
    - c1
    - c2