Unverified Commit 41399e0e authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #60689 from nikhita/bump-cobra-bash-alias

Automatic merge from submit-queue (batch tested with PRs 60732, 60689, 60648, 60704). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. bump(6644d4): spf13/cobra: support bash completion for aliases Fixes kubernetes/kubectl#120 `spf13/cobra` was recently bumped in https://github.com/kubernetes/kubernetes/pull/60530. The changes between then and now are: - Fix generated bash completion for Bash 3 (OSX): https://github.com/spf13/cobra/commit/fd32f09af19efc9b1279c54e0d8ed23f66232a15 - Try out CircleCI: https://github.com/spf13/cobra/commit/be77323fc05148ef091e83b3866c0d47c8e74a8b (but we don't vendor this in anyway) - Do not add a space after a single flag completion: https://github.com/spf13/cobra/commit/1a618fb24b01a0f393ccd82d55c4d8058bdeaf5c - Bash completion aliases: https://github.com/spf13/cobra/commit/a1e4933ab784095895e33dbe9f001ba10cfe2060 (the commit that fixes kubernetes/kubectl#120) - Prefix bash functions with root command name: https://github.com/spf13/cobra/commit/6644d46b81fa1831979c4cded0106e774e0ef0ab (the commit that completely fixes https://github.com/kubernetes/kubernetes/issues/60517) No license changes. **Release note**: ```release-note NONE ``` /cc mengqiy cblecker sttts
parents 6f1ee577 bae2db8b
...@@ -584,7 +584,7 @@ ...@@ -584,7 +584,7 @@
}, },
{ {
"ImportPath": "github.com/spf13/cobra", "ImportPath": "github.com/spf13/cobra",
"Rev": "93959269ad99e80983c9ba742a7e01203a4c0e4f" "Rev": "6644d46b81fa1831979c4cded0106e774e0ef0ab"
}, },
{ {
"ImportPath": "github.com/spf13/pflag", "ImportPath": "github.com/spf13/pflag",
......
...@@ -268,7 +268,7 @@ ...@@ -268,7 +268,7 @@
}, },
{ {
"ImportPath": "github.com/spf13/cobra", "ImportPath": "github.com/spf13/cobra",
"Rev": "93959269ad99e80983c9ba742a7e01203a4c0e4f" "Rev": "6644d46b81fa1831979c4cded0106e774e0ef0ab"
}, },
{ {
"ImportPath": "github.com/spf13/pflag", "ImportPath": "github.com/spf13/pflag",
......
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
}, },
{ {
"ImportPath": "github.com/spf13/cobra", "ImportPath": "github.com/spf13/cobra",
"Rev": "93959269ad99e80983c9ba742a7e01203a4c0e4f" "Rev": "6644d46b81fa1831979c4cded0106e774e0ef0ab"
}, },
{ {
"ImportPath": "github.com/spf13/pflag", "ImportPath": "github.com/spf13/pflag",
......
...@@ -204,3 +204,17 @@ __kubectl_get_namespaces() ...@@ -204,3 +204,17 @@ __kubectl_get_namespaces()
fi fi
} }
``` ```
# Using bash aliases for commands
You can also configure the `bash aliases` for the commands and they will also support completions.
```bash
alias aliasname=origcommand
complete -o default -F __start_origcommand aliasname
# and now when you run `aliasname` completion will make
# suggestions as it did for `origcommand`.
$) aliasname <tab><tab>
completion firstcommand secondcommand
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment