Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dlvhdr committed Jan 4, 2025
1 parent 49f01a2 commit 47b6877
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Usage:
gh dash [flags]
Flags:
-c, --config string use this configuration file (default is $GH_DASH_CONFIG, or if not set, $XDG_CONFIG_HOME/gh-dash/config.yml)
-c, --config string use this configuration file (default lookup: a .gh-dash.yml file if inside a current git repo, $GH_DASH_CONFIG env var, or if not set, $XDG_CONFIG_HOME/gh-dash/config.yml)
--debug passing this flag will allow writing debug output to debug.log
-h, --help help for gh-dash
```
Expand All @@ -114,7 +114,7 @@ A section is defined by a:
- title - shown in the TUI
- filters - how the repo's PRs should be filtered - these are plain [GitHub filters](https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests)

All configuration is provided within a `config.yml` file under the extension's directory (either `$XDG_CONFIG_HOME/gh-dash` or `~/.config/gh-dash/` or your OS config dir) or `$GH_DASH_CONFIG`.
All configuration is provided within a `config.yml` file under the extension's directory (either a `.gh-dash.yml` file if inside a repo, `$XDG_CONFIG_HOME/gh-dash` or `~/.config/gh-dash/` or your OS config dir) or `$GH_DASH_CONFIG`.

An example `config.yml` file contains:

Expand Down
7 changes: 6 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ func init() {
"config",
"c",
"",
"use this configuration file (default is $GH_DASH_CONFIG, or if not set, \n$XDG_CONFIG_HOME/gh-dash/config.yml)",
`use this configuration file
(default lookup:
1. a .gh-dash.yml file if inside a git repo
2. $GH_DASH_CONFIG env var
3. $XDG_CONFIG_HOME/gh-dash/config.yml
)`,
)
err := rootCmd.MarkPersistentFlagFilename("config", "yaml", "yml")
if err != nil {
Expand Down
11 changes: 6 additions & 5 deletions docs/content/getting-started/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To use `gh-dash`, follow these steps after you've [installed it][01]:
gh dash [flags]
Flags:
-c, --config string use this configuration file (default is $GH_DASH_CONFIG, or if not set, $XDG_CONFIG_HOME/gh-dash/config.yml)
-c, --config string use this configuration file (default lookup: a .gh-dash.yml file if inside a git repo, $GH_DASH_CONFIG env var, or if not set, $XDG_CONFIG_HOME/gh-dash/config.yml)
--debug passing this flag will allow writing debug output to debug.log
-h, --help help for gh-dash
```
Expand All @@ -41,15 +41,16 @@ gh dash --config path/to/configuration/file.yml

| Aliases | Type | Default |
| :------ | :----: | :------------------------------------ |
| `-c` | String | `$GH_DASH_CONFIG` or if not set, `$XDG_CONFIG_HOME/gh-dash-config.yml` |
| `-c` | String | `.gh-dash.yml` file if inside a git repo, `$GH_DASH_CONFIG` env var, or if not set, `$XDG_CONFIG_HOME/gh-dash-config.yml` |

If you don't specify this flag, `gh-dash` uses the default configuration. If the file doesn't exist, gh-dash will create it. The location of the default configuration file depends on your system:

1. If `$GH_DASH_CONFIG` is a non-empty string, `gh-dash` will use this file for
1. If Inside a git repo, `gh-dash` will look for a `.gh-dash.yml` file in the root of the repo.
2. If `$GH_DASH_CONFIG` is a non-empty string, `gh-dash` will use this file for
its configuration.
1. If `$GH_DASH_CONFIG` isn't set and `$XDG_CONFIG_HOME` is a non-empty string,
3. If `$GH_DASH_CONFIG` isn't set and `$XDG_CONFIG_HOME` is a non-empty string,
the default path is `$XDG_CONFIG_HOME/gh-dash/config.yml`.
1. If neither `$GH_DASH_CONFIG` or `$XDG_CONFIG_HOME` are set, then:
4. If neither `$GH_DASH_CONFIG` or `$XDG_CONFIG_HOME` are set, then:
- On Linux and macOS systems, the default path is `$HOME/gh-dash/config.yml`.
- On Windows systems, the default path is `%USERPROFILE%\gh-dash\config.yml`.

Expand Down

0 comments on commit 47b6877

Please sign in to comment.