feat: kn function force lowercase
This commit is contained in:
parent
165b63d463
commit
6ccce87f1a
4 changed files with 13 additions and 8 deletions
|
@ -14,13 +14,18 @@
|
|||
|
||||
function kn() {
|
||||
(set -e
|
||||
local ctx="${1%/*}"
|
||||
local ns="$2"
|
||||
|
||||
if [ -n "$2" ]; then
|
||||
kubectx "${1:l}"
|
||||
kubens "$2"
|
||||
else
|
||||
kubens "$@"
|
||||
if [ -z "$ns" ] && [ "$ctx" != "$1" ]; then
|
||||
ns="${1#*/}"
|
||||
fi
|
||||
if [ -n "$ns" ]; then
|
||||
kubectx "${ctx:l}"
|
||||
else
|
||||
ns="$ctx"
|
||||
fi
|
||||
kubens "${ns:l}"
|
||||
)
|
||||
}
|
||||
compdef -e _kubens.zsh kn
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 5bce72ef57255ab1c23d8fb753417859afe6e0f0
|
||||
Subproject commit 5ab517361a4215d2f777023fc1e772fe79496713
|
Loading…
Add table
Add a link
Reference in a new issue