diff --git a/.fast-run-git-command b/.fast-run-git-command index e856fa2..4a42b97 100644 --- a/.fast-run-git-command +++ b/.fast-run-git-command @@ -26,11 +26,24 @@ typeset -ga __lines_list local -a __response +if [[ $1 == --status ]] { + integer __status=1 + shift +} + if [[ -z ${FAST_HIGHLIGHT[$2-cache]} || $(( EPOCHSECONDS - FAST_HIGHLIGHT[$2-cache-born-at] )) -gt ${4:-5} ]]; then FAST_HIGHLIGHT[$2-cache-born-at]=$EPOCHSECONDS if [[ "$(command git rev-parse --is-inside-work-tree 2>/dev/null)" = true ]]; then __response=( ${${(f)"$(command ${(Qz)${1#+}} 2>/dev/null)"}#$3} ) - [[ "$1" = "+"* ]] && __lines_list+=( "${__response[@]}" ) || __lines_list=( "${__response[@]}" ) + integer retval=$? + if (( __status )) { + __response=( $retval ) + __lines_list=( $retval ) + } else { + [[ "$1" = "+"* ]] && \ + __lines_list+=( "${__response[@]}" ) || \ + __lines_list=( "${__response[@]}" ) + } else __lines_list=() fi