Skip to content

Commit

Permalink
Update config file location documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
uncenter committed Dec 10, 2024
1 parent 8f99583 commit 6467728
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6467728

Please sign in to comment.