mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-06-03 04:46:30 +00:00
Add bash and zsh completion support
This commit adds support for auto completion for bash and zsh shells. A new root level command called "completion" has been introduced, and the user can get the auto completion code by running `ark completion bash/zsh`. For bash completion, the built-in GenBashCompletion() from cobra has been used, but for zsh, the built-in GenZshCompletion() is known to cause issues. The workaround has been copied from zsh completion code of kubectl. Signed-off-by: Shubham <shubham@linux.com>
This commit is contained in:
committed by
Shubham
parent
a48cc6ed23
commit
7f3e88151b
@@ -32,6 +32,7 @@ operations can also be performed as 'ark backup get' and 'ark schedule create'.
|
||||
### SEE ALSO
|
||||
* [ark backup](ark_backup.md) - Work with backups
|
||||
* [ark client](ark_client.md) - Ark client related commands
|
||||
* [ark completion](ark_completion.md) - Output shell completion code for the specified shell (bash or zsh)
|
||||
* [ark create](ark_create.md) - Create ark resources
|
||||
* [ark delete](ark_delete.md) - Delete ark resources
|
||||
* [ark describe](ark_describe.md) - Describe ark resources
|
||||
|
||||
46
docs/cli-reference/ark_completion.md
Normal file
46
docs/cli-reference/ark_completion.md
Normal file
@@ -0,0 +1,46 @@
|
||||
## ark completion
|
||||
|
||||
Output shell completion code for the specified shell (bash or zsh)
|
||||
|
||||
### Synopsis
|
||||
|
||||
|
||||
Generate shell completion code.
|
||||
|
||||
Auto completion supports both bash and zsh. Output is to STDOUT.
|
||||
|
||||
Load the ark completion code for bash into the current shell -
|
||||
source <(ark completion bash)
|
||||
|
||||
Load the ark completion code for zsh into the current shell -
|
||||
source <(ark completion zsh)
|
||||
|
||||
|
||||
```
|
||||
ark completion SHELL [flags]
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for completion
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--alsologtostderr log to standard error as well as files
|
||||
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
|
||||
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
|
||||
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
|
||||
--log_dir string If non-empty, write log files in this directory
|
||||
--logtostderr log to standard error instead of files
|
||||
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
|
||||
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
|
||||
-v, --v Level log level for V logs
|
||||
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
* [ark](ark.md) - Back up and restore Kubernetes cluster resources.
|
||||
|
||||
Reference in New Issue
Block a user