From dbf44e045625fb1e24a2c497cf55d75cc74054e3 Mon Sep 17 00:00:00 2001 From: hophacker Date: Tue, 27 Oct 2020 14:50:20 +0800 Subject: [PATCH] unalias command in the right way --- zsh/functions.zsh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/zsh/functions.zsh b/zsh/functions.zsh index 61774d5..d722ffd 100644 --- a/zsh/functions.zsh +++ b/zsh/functions.zsh @@ -304,22 +304,22 @@ function kexec { { echo "Usage : $0 [options] [--] Options: - -C kubectl context + -K kubectl context -R not randomly select pod -n NAMESPACE -p PROJECT -h Display this message" } - while getopts ":hvC:Rp:" opt + while getopts ":hvK:Rp:" opt do case $opt in - C) KCONTEXT=$OPTARG ;; - R) RAN=false ;; - h) usage; return 0 ;; - n) NAMESPACE=$OPTARG ;; - p) PROJECT=$OPTARG ;; - *) echo -e "\n Option does not exist : $OPTARG\n" - usage; return 1 ;; + R) RAN=false ;; + h) usage; return 0 ;; + n) NAMESPACE=$OPTARG ;; + p) PROJECT=$OPTARG ;; + K) KCONTEXT=$OPTARG ;; + *) echo -e "\n Option does not exist: $OPTARG\n" + usage; return 1 ;; esac done shift $(($OPTIND-1)) @@ -433,6 +433,8 @@ function dc { function get_ip_of_ssh_hostname { ssh -G $1 | awk '/^hostname / { print $2 }' } +unalias gc 2>/dev/null +unalias gcm 2>/dev/null function gc { while true;do users=($GIT_USERS)