hapi-server / cache-tools

A collection of tools for reading, writing, and managing a cache of HAPI responses
0 stars 1 forks source link

--cache-dir should be optional and have a default #9

Open jbfaden opened 1 week ago

jbfaden commented 1 week ago

The --cache-dir argument is presently required, but I think it should have a default value. It's already a fairly long command line, and having a default encourages a standard place so that different codes will be more likely to use the same cache.

I suggest /hapi-cache/, so that it is transparent what is going on.

rweigel commented 1 week ago

Also consider that Python has a function that uses the os tmpdir. I usually use that as default and show it when help is shown and print it when --verbose is used.

The pattern of using the home dir as default is unconventional (if all programs did it, home dirs would have 10-100 dirs). Maybe research what database programs do.

Most OSs have a special directory, such as ~/Library/Caches on OS-X. See also https://mkyong.com/java/how-to-get-the-temporary-file-path-in-java/.

jbfaden commented 1 week ago

There's ~/.cache on Linux, too.