svent/sift

Add .sift.config location relative to the executable.

vovcacik opened this issue · 6 comments

Currently sift scans for config file in home directory and current working directory. Could you incorporate the directory sift.exe is in? It would improve portability.

Many tools let you specify where the config file is. Something like this would be nice:

sift --config=~/path/foo.conf
svent commented

Thanks for the suggestions, I think they both make sense.
I currently plan to implement the following:

The config is searched for (and merged) in the following order:

  • path of the sift binary
  • user home dir
  • recursive search in the parent directories (local project config)
  • optionally the config given via --config

is this done ?! I'm particularly interested in the recursive search in the parent directories

svent commented

The search in parent directories has been implemented for a long time - I hope to release a new version supporting the --config option in the next week.

svent commented

As of version 0.9, sift supports the --conf option.
Sift currently does not search the path of the binary - unfortunately that feature would require to use platform dependent, unsafe code outside the Go standard library, so I will not (yet) implement that for stability reasons.

Works fine for me, thx.