Skip to content

Commit

Permalink
Fix -e option (fixes #239) (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruduran authored and rupa committed Jun 9, 2018
1 parent ea5ec78 commit fdf133e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion z.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}" ] && {
Expand Down Expand Up @@ -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";;
Expand Down

0 comments on commit fdf133e

Please sign in to comment.