From fdf133e9fe5be8fd425727ee2286a84dc0c91844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Dur=C3=A1n=20Balda?= Date: Sun, 10 Jun 2018 00:32:18 +0200 Subject: [PATCH] Fix -e option (fixes #239) (#242) --- z.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/z.sh b/z.sh index 86cdb7c..4fc75dc 100644 --- a/z.sh +++ b/z.sh @@ -21,6 +21,7 @@ # * z -r foo # cd to highest ranked dir matching foo # * z -t foo # cd to most recently accessed dir matching foo # * z -l foo # list matches instead of cd +# * z -e foo # echo the best match, don't cd # * z -c foo # restrict matches to subdirs of $PWD [ -d "${_Z_DATA:-$HOME/.z}" ] && { @@ -113,7 +114,7 @@ _z() { --) while [ "$1" ]; do shift; local fnd="$fnd${fnd:+ }$1";done;; -*) local opt=${1:1}; while [ "$opt" ]; do case ${opt:0:1} in c) local fnd="^$PWD $fnd";; - e) local echo=echo;; + e) local echo=1;; h) echo "${_Z_CMD:-z} [-cehlrtx] args" >&2; return;; l) local list=1;; r) local typ="rank";;