diff --git a/.zshrc2 b/.zshrc2 index 68f9327..63dc6a3 100644 --- a/.zshrc2 +++ b/.zshrc2 @@ -95,7 +95,7 @@ esac sibd() { ssh -p 12022 root@$1${1:+.}ibd.ink } sob() { ssh -p 24022 root@$1${1:+.}ob.ac.cn } snasp() { ssh -o ProxyJump="ssh@nasp.ob.ac.cn:36022" dictxiong@$1 } -git-branches() { git for-each-ref --sort=-committerdate refs/heads refs/remotes --format="%(authordate:format:%y-%m-%d.%a %H:%M %z)|%(color:red)%(objectname:short)|%(color:yellow)%(refname:short)%(color:reset)|%(color:reset)%(authorname): %(color:green)%(subject)" --color=always --count=${1:-10} | column -ts"|" } +gbes() { git for-each-ref --sort=-committerdate refs/heads refs/remotes --format="%(authordate:format:%y-%m-%d.%a %H:%M %z)|%(color:red)%(objectname:short)|%(color:yellow)%(refname:short)%(color:reset)|%(color:reset)%(authorname): %(color:green)%(subject)" --color=always | column -ts"|" | less -FX } piv-agent() { eval $(ssh-agent -k) diff --git a/install.sh b/install.sh index 722ad1d..c20add2 100755 --- a/install.sh +++ b/install.sh @@ -258,7 +258,7 @@ uninstall(){ parse_arg "$@" FUNC=install -for i in ${ARG_PARSED[@]}; do +for i in ${PARSE_ARG_RET[@]}; do case $i in -i ) FUNC=install ;; -r ) FUNC=uninstall ;; diff --git a/tools/common.sh b/tools/common.sh index 9a6c97f..c376518 100755 --- a/tools/common.sh +++ b/tools/common.sh @@ -105,14 +105,14 @@ fi parse_arg() { local ARG="" - ARG_PARSED=() + PARSE_ARG_RET=() while [[ $# > 0 || -n "$ARG" ]]; do if [[ -z "$ARG" ]]; then ARG=$1; shift; fi case $ARG in - -q*|--quite ) export DFS_QUIET=1 ;; - --* ) ARG_PARSED+=("$ARG") ;; - -* ) ARG_PARSED+=("${ARG:0:2}") ;; - * ) ARG_PARSED+=("$ARG") ;; + -q*|--quite ) DFS_QUIET=1 ;; + --* ) PARSE_ARG_RET+=("$ARG") ;; + -* ) PARSE_ARG_RET+=("${ARG:0:2}") ;; + * ) PARSE_ARG_RET+=("$ARG") ;; esac if [[ "$ARG" == "--"* || ! "$ARG" == "-"* || ${#ARG} -le 2 ]]; then ARG="" @@ -191,3 +191,5 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then else setup_color fi + +unset THIS_DIR_COMMON_SH