Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Update shell autocompletion instructions #3377

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading