Skip to content

Commit

Permalink
Improve directions on how to set up completion
Browse files Browse the repository at this point in the history
  • Loading branch information
oalders committed Jun 20, 2024
1 parent ac6b2cd commit d24d07c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,25 @@ $ is known cli version --patch tmux
Please see the docs on `os version` for more information on `--major`,
`--minor` and `--patch`.

### install-completions

This is a two step process. First, run

```bash
is install-completions
```

Then run the command which is printed to your terminal in order to get
completion in your current session.

```bash
$ is install-completions
complete -C /Users/olaf/local/bin/is is
```

Or add the command to a `.bashrc` or similar in order to get completion across
all sessions.

### --debug

Print some debugging information to `STDOUT`.
Expand All @@ -910,6 +929,8 @@ Top level command help.
```text
Usage: is <command>
an inspector for your environment
Flags:
-h, --help Show context-sensitive help.
--debug turn on debugging statements
Expand Down Expand Up @@ -951,6 +972,12 @@ Commands:
user [<sudoer>]
Info about current user. e.g. "is user sudoer"
install-completions
install shell completions. e.g. "is install-completions" and then run the
command which is printed to your terminal to get completion in your current
session. add the command to a .bashrc or similar to get completion across
all sessions.
Run "is <command> --help" for more information on a command.
```

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func main() {
User UserCmd `cmd:"" help:"Info about current user. e.g. \"is user sudoer\""`
Version kong.VersionFlag `help:"Print version to screen"`

InstallCompletions kongplete.InstallCompletions `cmd:"" help:"install shell completions. e.g. \"is install-completions\" and then run the command which is printed to your terminal"` //nolint:lll
InstallCompletions kongplete.InstallCompletions `cmd:"" help:"install shell completions. e.g. \"is install-completions\" and then run the command which is printed to your terminal to get completion in your current session. add the command to a .bashrc or similar to get completion across all sessions."` //nolint:lll
}

parser := kong.Must(&API,
Expand Down

0 comments on commit d24d07c

Please sign in to comment.