make klogs a workable command which logs amonst k8s applicaiton

This commit is contained in:
hophacker 2020-02-27 21:27:57 +08:00
parent 051ab834ef
commit e2baa7ef69

View File

@ -388,19 +388,26 @@ function kexec {
fi fi
} }
function k_logs { function klogs {
CONTEXT=gcloud KCONTEXT=${KCONTEXT:-gcloud}
while getopts ":c:p:" opt; do finalopts=()
case "${opt}" in while [[ $@ != "" ]] do
c) case $1 in
CONTEXT=$OPTARG -c)
KCONTEXT="$2"
shift; shift
;; ;;
p) --context=*)
PROJECT=$OPTARG KCONTEXT="${i#*=}"
shift
;;
-p)
PROJECT="$2"
shift; shift
;; ;;
*) *)
echo "Usage: cmd [-h]" finalopts+=($1)
return shift
;; ;;
esac esac
done done