diff --git a/z.1 b/z.1 index bed5d3b..e94d81b 100644 --- a/z.1 +++ b/z.1 @@ -4,7 +4,7 @@ NAME z \- jump around .SH SYNOPSIS -z [\-c] [\-h] [\-l] [\-r] [\-t] [regex1 regex2 ... regexn] +z [\-chlrt] [regex1 regex2 ... regexn] .SH AVAILABILITY bash, zsh diff --git a/z.sh b/z.sh index 7b0f02e..c54872e 100755 --- a/z.sh +++ b/z.sh @@ -101,12 +101,14 @@ _z() { else # list/go while [ "$1" ]; do case "$1" in - -c) local fnd="$PWD $fnd";; - -h) echo "${_Z_CMD:-z} [-c][-h][-l][-r][-t] args" >&2; return;; - -l) local list=1;; - -r) local typ="rank";; - -t) local typ="recent";; --) while [ "$1" ]; do shift; local fnd="$fnd $1";done;; + -*) local opt=${1:1}; while [ "$opt" ]; do case ${opt:0:1} in + c) local fnd="$PWD $fnd";; + h) echo "${_Z_CMD:-z} [-chlrt] args" >&2; return;; + l) local list=1;; + r) local typ="rank";; + t) local typ="recent";; + esac; opt=${opt:1}; done;; *) local fnd="$fnd $1";; esac; local last=$1; shift; done [ "$fnd" -a "$fnd" != "$PWD " ] || local list=1