Httpie: Follow the XDG base directory specification

Created on 4 Jun 2013  Â·  9Comments  Â·  Source: httpie/httpie

Instead of using config at $HOME/.httpie, the default should be ${XDG_CONFIG_HOME:-$HOME/.config}/httpie for unix-based operating systems according to the XDG Base Directory Specification.

As well as keeping the home directory clean, the semantic separation of config, runtime data, cache data and user-local software by the spec is helpful to users and other tools (e.g. backup software).

In terms of migration, I would suggest using the xdg-compilant config location if it exists and falling back to the current default location. This would also negate the need for the $HTTPIE_CONFIG_DIR variable, so it could be removed/de-emphasised from the documentation but still checked for at least a few versions for compatibility.

Most helpful comment

There is already a pull request for this. Any reason against this change?

All 9 comments

:+1: for this. Though I think keeping HTTPIE_CONFIG_DIR around would be OK.

Please yes, thanks to many projects moving over to XDG I have finally managed to reduce my $HOME to only the files and directory that I created and care about (excluding historical hardcoded locations such as .ssh, .pki and so on).

That means over 70 projects support XDG in some form or another. Please consider doing this for httpie \o/

Current work around is adding export HTTPIE_CONFIG_DIR="$XDG_CONFIG_HOME/httpie" to your bashrc.

Yes, I am aware of that, I currently have quite a few to maintain. It would be much better if this was supported by default.

keyword "work around", it would be such a perfect world if everyone could just stick some standard, and XDG base directory spec is a really good one. so i would also like to see supported by default

huge :+1: for this

There is already a pull request for this. Any reason against this change?

I just ran into this myself – are there any plans to change the default behaviour here?

Yeah, it doesn't make much sense to trade less $HOME directory clutter for more environment setup clutter, so just changing the default is the way to go.

Was this page helpful?
0 / 5 - 0 ratings