mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-06-20 20:52:27 +00:00
simplify argument processing in kubectx
This commit is contained in:
parent
45791dad13
commit
afc74a0ce0
5
kubectx
5
kubectx
@ -224,8 +224,6 @@ main() {
|
|||||||
usage "missing context NAME"
|
usage "missing context NAME"
|
||||||
fi
|
fi
|
||||||
delete_contexts "${@:2}"
|
delete_contexts "${@:2}"
|
||||||
elif [[ "$#" -gt 1 ]]; then
|
|
||||||
usage "too many arguments"
|
|
||||||
elif [[ "$#" -eq 1 ]]; then
|
elif [[ "$#" -eq 1 ]]; then
|
||||||
if [[ "${1}" == "-" ]]; then
|
if [[ "${1}" == "-" ]]; then
|
||||||
swap_context
|
swap_context
|
||||||
@ -246,8 +244,7 @@ main() {
|
|||||||
set_context "${1}"
|
set_context "${1}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
usage
|
usage "too many arguments"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user