From d24d07c778f944dda4bd8ac2d6d0194ee688c353 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Wed, 19 Jun 2024 23:01:21 -0400 Subject: [PATCH] Improve directions on how to set up completion --- README.md | 27 +++++++++++++++++++++++++++ main.go | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ebddd1b..b0cd6b5 100644 --- a/README.md +++ b/README.md @@ -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`. @@ -910,6 +929,8 @@ Top level command help. ```text Usage: is +an inspector for your environment + Flags: -h, --help Show context-sensitive help. --debug turn on debugging statements @@ -951,6 +972,12 @@ Commands: user [] 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 --help" for more information on a command. ``` diff --git a/main.go b/main.go index 58ad456..f3c37fe 100644 --- a/main.go +++ b/main.go @@ -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,