mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-08-09 11:17:44 +00:00
help exit status 0 (#72)
This commit is contained in:
parent
7bc9a1277c
commit
e368d13eea
5
kubectx
5
kubectx
@ -37,7 +37,6 @@ USAGE:
|
||||
|
||||
kubectx -h,--help : show this message
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
current_context() {
|
||||
@ -176,11 +175,13 @@ main() {
|
||||
if [[ "$#" -lt 2 ]]; then
|
||||
echo "error: missing context NAME" >&2
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
delete_contexts "${@:2}"
|
||||
elif [[ "$#" -gt 1 ]]; then
|
||||
echo "error: too many arguments" >&2
|
||||
usage
|
||||
exit 1
|
||||
elif [[ "$#" -eq 1 ]]; then
|
||||
if [[ "${1}" == "-" ]]; then
|
||||
swap_context
|
||||
@ -189,6 +190,7 @@ main() {
|
||||
elif [[ "${1}" =~ ^-(.*) ]]; then
|
||||
echo "error: unrecognized flag \"${1}\"" >&2
|
||||
usage
|
||||
exit 1
|
||||
elif [[ "${1}" =~ (.+)=(.+) ]]; then
|
||||
rename_context "${BASH_REMATCH[2]}" "${BASH_REMATCH[1]}"
|
||||
else
|
||||
@ -196,6 +198,7 @@ main() {
|
||||
fi
|
||||
else
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
3
kubens
3
kubens
@ -31,7 +31,6 @@ USAGE:
|
||||
kubens - : switch to the previous namespace in this context
|
||||
kubens -h,--help : show this message
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
current_namespace() {
|
||||
@ -147,6 +146,7 @@ main() {
|
||||
elif [[ "${1}" =~ ^-(.*) ]]; then
|
||||
echo "error: unrecognized flag \"${1}\"" >&2
|
||||
usage
|
||||
exit 1
|
||||
elif [[ "${1}" =~ (.+)=(.+) ]]; then
|
||||
alias_context "${BASH_REMATCH[2]}" "${BASH_REMATCH[1]}"
|
||||
else
|
||||
@ -155,6 +155,7 @@ main() {
|
||||
else
|
||||
echo "error: too many flags" >&2
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user