mirror of
https://github.com/fluxcd/flux2.git
synced 2025-11-02 18:58:33 +08:00
Merge pull request #235 from stealthybox/shell-completions
Support bash, fish, zsh, and powershell shell completions as separate sub-commands
This commit is contained in:
@ -78,7 +78,7 @@ Command line utility for assembling Kubernetes CD pipelines the GitOps way.
|
||||
|
||||
* [gotk bootstrap](gotk_bootstrap.md) - Bootstrap toolkit components
|
||||
* [gotk check](gotk_check.md) - Check requirements and installation
|
||||
* [gotk completion](gotk_completion.md) - Generates bash completion scripts
|
||||
* [gotk completion](gotk_completion.md) - Generates completion scripts for various shells
|
||||
* [gotk create](gotk_create.md) - Create or update sources and resources
|
||||
* [gotk delete](gotk_delete.md) - Delete sources and resources
|
||||
* [gotk export](gotk_export.md) - Export resources in YAML format
|
||||
|
||||
@ -1,28 +1,10 @@
|
||||
## gotk completion
|
||||
|
||||
Generates bash completion scripts
|
||||
Generates completion scripts for various shells
|
||||
|
||||
### Synopsis
|
||||
|
||||
Generates bash completion scripts
|
||||
|
||||
```
|
||||
gotk completion [flags]
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
To load completion run
|
||||
|
||||
. <(gotk completion)
|
||||
|
||||
To configure your bash shell to load completions for each session add to your bashrc
|
||||
|
||||
# ~/.bashrc or ~/.profile
|
||||
. <(gotk completion)
|
||||
|
||||
```
|
||||
The completion sub-command generates completion scripts for various shells
|
||||
|
||||
### Options
|
||||
|
||||
@ -42,4 +24,8 @@ To configure your bash shell to load completions for each session add to your ba
|
||||
### SEE ALSO
|
||||
|
||||
* [gotk](gotk.md) - Command line utility for assembling Kubernetes CD pipelines
|
||||
* [gotk completion bash](gotk_completion_bash.md) - Generates bash completion scripts
|
||||
* [gotk completion fish](gotk_completion_fish.md) - Generates fish completion scripts
|
||||
* [gotk completion powershell](gotk_completion_powershell.md) - Generates powershell completion scripts
|
||||
* [gotk completion zsh](gotk_completion_zsh.md) - Generates zsh completion scripts
|
||||
|
||||
|
||||
45
docs/cmd/gotk_completion_bash.md
Normal file
45
docs/cmd/gotk_completion_bash.md
Normal file
@ -0,0 +1,45 @@
|
||||
## gotk completion bash
|
||||
|
||||
Generates bash completion scripts
|
||||
|
||||
### Synopsis
|
||||
|
||||
Generates bash completion scripts
|
||||
|
||||
```
|
||||
gotk completion bash [flags]
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
To load completion run
|
||||
|
||||
. <(gotk completion bash)
|
||||
|
||||
To configure your bash shell to load completions for each session add to your bashrc
|
||||
|
||||
# ~/.bashrc or ~/.profile
|
||||
command -v gotk >/dev/null && . <(gotk completion bash)
|
||||
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for bash
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||
--namespace string the namespace scope for this operation (default "gitops-system")
|
||||
--timeout duration timeout for this operation (default 5m0s)
|
||||
--verbose print generated objects
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [gotk completion](gotk_completion.md) - Generates completion scripts for various shells
|
||||
|
||||
46
docs/cmd/gotk_completion_fish.md
Normal file
46
docs/cmd/gotk_completion_fish.md
Normal file
@ -0,0 +1,46 @@
|
||||
## gotk completion fish
|
||||
|
||||
Generates fish completion scripts
|
||||
|
||||
### Synopsis
|
||||
|
||||
Generates fish completion scripts
|
||||
|
||||
```
|
||||
gotk completion fish [flags]
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
To load completion run
|
||||
|
||||
. <(gotk completion fish)
|
||||
|
||||
To configure your fish shell to load completions for each session write this script to your completions dir:
|
||||
|
||||
gotk completion fish > ~/.config/fish/completions/gotk
|
||||
|
||||
See http://fishshell.com/docs/current/index.html#completion-own for more details
|
||||
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for fish
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||
--namespace string the namespace scope for this operation (default "gitops-system")
|
||||
--timeout duration timeout for this operation (default 5m0s)
|
||||
--verbose print generated objects
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [gotk completion](gotk_completion.md) - Generates completion scripts for various shells
|
||||
|
||||
52
docs/cmd/gotk_completion_powershell.md
Normal file
52
docs/cmd/gotk_completion_powershell.md
Normal file
@ -0,0 +1,52 @@
|
||||
## gotk completion powershell
|
||||
|
||||
Generates powershell completion scripts
|
||||
|
||||
### Synopsis
|
||||
|
||||
Generates powershell completion scripts
|
||||
|
||||
```
|
||||
gotk completion powershell [flags]
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
To load completion run
|
||||
|
||||
. <(gotk completion powershell)
|
||||
|
||||
To configure your powershell shell to load completions for each session add to your powershell profile
|
||||
|
||||
Windows:
|
||||
|
||||
cd "$env:USERPROFILE\Documents\WindowsPowerShell\Modules"
|
||||
gotk completion >> gotk-completion.ps1
|
||||
|
||||
Linux:
|
||||
|
||||
cd "${XDG_CONFIG_HOME:-"$HOME/.config/"}/powershell/modules"
|
||||
gotk completion >> gotk-completions.ps1
|
||||
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for powershell
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||
--namespace string the namespace scope for this operation (default "gitops-system")
|
||||
--timeout duration timeout for this operation (default 5m0s)
|
||||
--verbose print generated objects
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [gotk completion](gotk_completion.md) - Generates completion scripts for various shells
|
||||
|
||||
53
docs/cmd/gotk_completion_zsh.md
Normal file
53
docs/cmd/gotk_completion_zsh.md
Normal file
@ -0,0 +1,53 @@
|
||||
## gotk completion zsh
|
||||
|
||||
Generates zsh completion scripts
|
||||
|
||||
### Synopsis
|
||||
|
||||
Generates zsh completion scripts
|
||||
|
||||
```
|
||||
gotk completion zsh [flags]
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
To load completion run
|
||||
|
||||
. <(gotk completion zsh) && compdef _gotk gotk
|
||||
|
||||
To configure your zsh shell to load completions for each session add to your zshrc
|
||||
|
||||
# ~/.zshrc or ~/.profile
|
||||
command -v gotk >/dev/null && . <(gotk completion zsh) && compdef _gotk gotk
|
||||
|
||||
or write a cached file in one of the completion directories in your ${fpath}:
|
||||
|
||||
echo "${fpath// /\n}" | grep -i completion
|
||||
gotk completions zsh > _gotk
|
||||
|
||||
mv _gotk ~/.oh-my-zsh/completions # oh-my-zsh
|
||||
mv _gotk ~/.zprezto/modules/completion/external/src/ # zprezto
|
||||
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for zsh
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||
--namespace string the namespace scope for this operation (default "gitops-system")
|
||||
--timeout duration timeout for this operation (default 5m0s)
|
||||
--verbose print generated objects
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [gotk completion](gotk_completion.md) - Generates completion scripts for various shells
|
||||
|
||||
Reference in New Issue
Block a user