Merge branch 'master' into dev

This commit is contained in:
rupa committed 2013-03-03 02:25:52 -05:00
commit 9b98949bd9
3 files changed
+12 -5

No files matched your search

+3 -1
View File
@@ -6,7 +6,7 @@ NAME
z - jump around z - jump around
SYNOPSIS SYNOPSIS
z [-h] [-l] [-r] [-t] [regex1 regex2 ... regexn] z [-c] [-h] [-l] [-r] [-t] [regex1 regex2 ... regexn]
AVAILABILITY AVAILABILITY
bash, zsh bash, zsh
@@ -18,6 +18,8 @@ DESCRIPTION
directory that matches ALL of the regexes given on the command line. directory that matches ALL of the regexes given on the command line.
OPTIONS OPTIONS
-c restrict matches to subdirectories of the current directory.
-h show a brief help message -h show a brief help message
-l list only -l list only
+4 -1
View File
@@ -4,7 +4,7 @@ NAME
z \- jump around z \- jump around
.SH .SH
SYNOPSIS SYNOPSIS
z [\-h] [\-l] [\-r] [\-t] [regex1 regex2 ... regexn] z [\-c] [\-h] [\-l] [\-r] [\-t] [regex1 regex2 ... regexn]
.SH .SH
AVAILABILITY AVAILABILITY
bash, zsh bash, zsh
@@ -17,6 +17,9 @@ directory that matches ALL of the regexes given on the command line.
.SH .SH
OPTIONS OPTIONS
.TP .TP
\fB\-c\fR
restrict matches to subdirectories of the current directory.
.TP
\fB\-h\fR \fB\-h\fR
show a brief help message show a brief help message
.TP .TP
+5 -3
View File
@@ -19,7 +19,8 @@
# * z foo bar # cd to most frecent dir matching foo and bar # * z foo bar # cd to most frecent dir matching foo and bar
# * z -r foo # cd to highest ranked dir matching foo # * z -r foo # cd to highest ranked dir matching foo
# * z -t foo # cd to most recently accessed dir matching foo # * z -t foo # cd to most recently accessed dir matching foo
# * z -l foo # list all dirs matching foo (by frecency) # * z -l foo # list matches instead of cd
# * z -c foo # restrict matches to subdirs of $PWD
case $- in case $- in
*i*) ;; *i*) ;;
@@ -100,14 +101,15 @@ _z() {
else else
# list/go # list/go
while [ "$1" ]; do case "$1" in while [ "$1" ]; do case "$1" in
-h) echo "z [-h][-l][-r][-t] args" >&2; return;; -c) local fnd="$PWD $fnd";;
-h) echo "${_Z_CMD:-z} [-c][-h][-l][-r][-t] args" >&2; return;;
-l) local list=1;; -l) local list=1;;
-r) local typ="rank";; -r) local typ="rank";;
-t) local typ="recent";; -t) local typ="recent";;
--) while [ "$1" ]; do shift; local fnd="$fnd $1";done;; --) while [ "$1" ]; do shift; local fnd="$fnd $1";done;;
*) local fnd="$fnd $1";; *) local fnd="$fnd $1";;
esac; local last=$1; shift; done esac; local last=$1; shift; done
[ "$fnd" ] || local list=1 [ "$fnd" -a "$fnd" != "$PWD " ] || local list=1
# if we hit enter on a completion just go there # if we hit enter on a completion just go there
case "$last" in case "$last" in