summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconf3
1 files changed, 3 insertions, 0 deletions
diff --git a/conf b/conf
index 450a65c..2ef73ba 100755
--- a/conf
+++ b/conf
@@ -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