diff options
-rwxr-xr-x | conf | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -147,6 +147,7 @@ function edit { matched+=( "${configs[$c]}" ) fi done + [ ${#matched[@]} -eq 1 ] && [ "${TERM}" == "dumb" ] && echo "${matched[0]}" && return 0 [ ${#matched[@]} -eq 1 ] && ${EDITOR} "${matched[0]}" && return 0 [ ${#matched[@]} -gt 1 ] && warn "Too many files, specify" && list -g "${1}" && return 1 @@ -156,12 +157,14 @@ function edit { matched+=( "${configs[$c]}" ) fi done + [ ${#matched[@]} -eq 1 ] && [ "${TERM}" == "dumb" ] && echo "${matched[0]}" && return 0 [ ${#matched[@]} -eq 1 ] && ${EDITOR} "${matched[0]}" && return 0 [ ${#matched[@]} -gt 1 ] && warn "Too many files, specify" && list -l | grep "${1}" && return 1 matched=() for c in "${!configs[@]}"; do if [ "${c}" == "$1" ]; then + [ "${TERM}" == "dumb" ] && echo "${configs[$c]}" && return 0 ${EDITOR} "${configs[$c]}" && return 0 fi done |