diff --git a/README.md b/README.md index 78f6e02..cc45437 100644 --- a/README.md +++ b/README.md @@ -53,18 +53,15 @@ If you find yourself providing the same arguments frequently, you can create and `gfold` does not come with a config file by default and config files are entirely optional. How does it work? -Upon execution, `gfold` will look for a config file at the following path on macOS, Linux and similar operating systems. +Upon execution, `gfold` will look for a config file at the following paths (in order): +- `$XDG_CONFIG_HOME/gfold.toml` +- `$XDG_CONFIG_HOME/gfold/config.toml` +- `$HOME/.config/gfold.toml` -```shell -$HOME/.config/gfold.toml -``` +`$XDG_CONFIG_HOME` refers to the literal `XDG_CONFIG_HOME` environment variable, but will default to the appropriate operating system-specific path if not set (see [`user_dirs`](https://github.com/uncenter/user_dirs) for more information). -On Windows, the lookup path will be in a similar location. - -```powershell -{FOLDERID_Profile}\.config\gfold.toml -``` +If a config file is found, `gfold` will read it and use the options specified within. For config file creation, you can use the `--dry-run` flag to print valid TOML. Here is an example config file creation workflow on macOS, Linux and similar platforms: @@ -203,8 +200,8 @@ Please [file an issue](https://github.com/nickgerace/gfold/issues) if your platf There are two ways to use `gfold` as a "library". -1) Use the [`libgfold`](./lib/libgfold/README.md) crate that powers `gfold` -1) Consume valid JSON results from `gfold -d json` (not a library, but useful for non-Rust applications) +1. Use the [`libgfold`](./lib/libgfold/README.md) crate that powers `gfold` +1. Consume valid JSON results from `gfold -d json` (not a library, but useful for non-Rust applications) ## Troubleshooting and Known Issues diff --git a/src/cli.rs b/src/cli.rs index 58fe9de..a3db0cf 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -19,11 +19,11 @@ Description: Config File Usage: While CLI options are prioritized, default options will fallback to the - config file if it exists. Here is the config file lookup locations for some - common platforms: + config file if it exists. Here are the config file lookup locations: - macOS, Linux, etc. $HOME/.config/gfold.toml - Windows {{FOLDERID_Profile}}\\.config\\gfold.toml + $XDG_CONFIG_HOME/gfold.toml + $XDG_CONFIG_HOME/gfold/config.toml + $HOME/.config/gfold.toml (or {{FOLDERID_Profile}}\\.config\\gfold.toml on Windows) Troubleshooting: Investigate unexpected behavior by prepending execution with