zquestz / s

Open a web search in your terminal.
MIT License
2.32k stars 114 forks source link

Customize configuration file path with a command line flag and/or use XDG #137

Closed R3load closed 5 years ago

R3load commented 5 years ago

Customize config file path

By specifying an alternate config file on the command line (like ssh -F):

s --config=/path/to/s/config <query> [flags]

Preferring $XDG_CONFIG_HOME as the user config dir, with ~/.config as fallback:

$XDG_CONFIG_HOME="/home/$USER/local/cfg" s <query> [flags]
zquestz commented 5 years ago

Unfortunately this is not trivial to implement. The configuration file is actually loaded before the flags are parsed. For now I would just symlink the config if you want it at another location.

I would be open to a PR for this functionality.