Skip to content

Commit

Permalink
Update shell autocompletion instructions
Browse files Browse the repository at this point in the history
Signed-off-by: John Pitman <[email protected]>
  • Loading branch information
jopit committed Feb 16, 2024
1 parent fcb88f0 commit ca248ed
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,21 @@ kubectl argo rollouts version

## Shell auto completion

The CLI can export shell completion code for several shells.
To enable auto completion for the plugin when used with `kubectl` (version 1.26 or newer), you need to create a shell script on your PATH called `kubectl_complete-argo-rollouts` which will provide the completions.

```shell
cat <<EOF >kubectl_complete-argo-rollouts
#!/usr/bin/env sh
# Call the __complete command passing it all arguments
kubectl argo rollouts __complete "\$@"
EOF
chmod +x kubectl_complete-argo-rollouts
sudo mv ./kubectl_complete-argo-rollouts /usr/local/bin/
```

To enable auto completion for the CLI run as a standalone binary, the CLI can export shell completion code for several shells.

For bash, ensure you have bash completions installed and enabled. To access completions in your current shell, run $ `source <(kubectl-argo-rollouts completion bash)`. Alternatively, write it to a file and source in `.bash_profile`.

Expand Down Expand Up @@ -120,4 +134,3 @@ To upgrade Argo Rollouts:
If deployments are happening while you upgrade the controller, then you shouldn't
have any downtime. Current Rollouts will be paused and as soon as the new controller becomes
active it will resume all in-flight deployments.

0 comments on commit ca248ed

Please sign in to comment.