minoki / cluttex

Process LaTeX documents without cluttering your working directory
GNU General Public License v3.0
45 stars 3 forks source link

Make --watch an option to select the watch engine #10

Closed atticus-sullivan closed 1 year ago

atticus-sullivan commented 2 years ago

Background behind this is that for some reason fswatch doesn't work for me (strangely only in some directories, might be a problem with symlinks or so, but I didn't found out yet).

Thus I wanted to use inotifywait which isn't possible with the current wait engine check (if fswatch is installed it always is preferred over inotifywait).

Please check if I used your commandline options library correctly, because I'm not sure of this. And in addition I wonder if there is a way to perform some parameter validity check with your library (I didn't found one)?


If there is no such feature, I'd propose to add a new key to the option_spec table entries (e.g. valid_check) which could be a table with the allowed values or a function to manually check for validity. Then somewhere I now have placed the validity check for the watch option there could be a function check_paramters which then performs the validity check (after the color etc has been set for nice error messages).

In case you also think it would be worth to do so, further discussion/work should be in a new issue/pull request

atticus-sullivan commented 1 year ago

Just checking on this PR. Are there any problems with these changes? / Opinions?

minoki commented 1 year ago

Looks good. Thanks!