Skip to content
This repository has been archived by the owner on May 11, 2020. It is now read-only.

Support XDG spec on macOS for command line apps #4

Closed
cjbassi opened this issue Feb 11, 2019 · 2 comments
Closed

Support XDG spec on macOS for command line apps #4

cjbassi opened this issue Feb 11, 2019 · 2 comments

Comments

@cjbassi
Copy link
Contributor

cjbassi commented Feb 11, 2019

So it turns out that the app directory spec used by command line apps on macOS tends to be the XDG spec rather than the standard macOS spec, and the XDG spec seems to be preferred/expected by macOS users too. The standard macOS spec is more commonly used for GUI applications. Reference: dirs-dev/directories-rs#47 which also links to some other discussions too.

Couple ideas:

  • default to XDG spec for macOS
  • provide an option to decide between the two on macOS
  • or both

Thoughts on this? Thanks!

@emersion
Copy link
Contributor

Hmm, I'm not sure. This package is primarily for cross-platform GUI applications that want to use the preferred directories for the platform they run on. On macOS, it makes sense to use Apple's guidelines.

I suspect CLI apps hardcode XDG anyway. So I think it would actually make more sense to always use env variables in your app (or use an XDG package, but it's so small it's probably not worth it). This comment seems to confirm this idea:

I would strongly expect any command line tool to use XDG standard location for config.

@cjbassi
Copy link
Contributor Author

cjbassi commented Feb 11, 2019

I think it would actually make more sense to always use env variables in your app (or use an XDG package, but it's so small it's probably not worth it).

I agree that does make more sense actually :D. cli apps on windows would probably use XDG too (although I haven't seen any discussion on it), so that shouldn't be a problem. Thanks for the suggestion about that.

One last thought is that it might be good to update the readme to mention that this package is only for gui applications, and that cli apps should instead use/implement the xdg spec since that's what expected. Seems like there's been some confusion for cli apps about using appdir-like packages.

@cjbassi cjbassi closed this as completed Feb 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants