Closed joliver closed 10 years ago
What use case are you are trying to fulfill? Do you just want the file named something different?
Exactly. We've got a strict naming convention and this is the perfect tool. By having a "-n" option for sync just like save, it allows user-defined file naming requirements. I was about to write my own tool but then I found yours. The only thing I needed was a custom filename. Otherwise this tool is perfect.
Also the travis failure appears to be because of a missing travis-ci file. I'm using code in this pull request right now without trouble.
I just added the .travis.yml
I wonder if an even better solution for you would be to look for the glockfile name as an environment variable, falling back to GLOCKFILE otherwise?
If you want to support a variable GLOCKFILE filename, then there's four ways I can see this working:
-f custom-file.txt
GLOCKFILE=custom-file.txt
Of the four options, the standard in method is the least heavy handed, imposes the least amount of cognitive overhead, and most closely aligns with the Unix philosophy. Following that, a command-line argument with something like --file or -f is the next best option.
Beyond the reasons above, I also wanted to follow the previously established convention set forth in your library of using -n
for standard in/out.
Would you like to pull the latest and merge my changes?
Thanks, I ended up doing it a little bit differently -- https://github.com/robfig/glock/commit/30723574b54030cef8a13e672ce287f29c59f369
Let me know how it works for you
I just added the ability for sync to behave like save which can read from stdin. This allows users of this tool to specify their own names to the
GLOCKFILE
.