Revert most changes in fasd and git-submodule-move
This commit is contained in:
parent
9825211740
commit
23c2dc1f13
3 changed files with 9 additions and 9 deletions
|
@ -125,7 +125,7 @@ case $1 in
|
|||
# add current pwd if the option is set
|
||||
[ "$_FASD_TRACK_PWD" = "1" -a "$PWD" != "$HOME" ] && paths="$paths|$PWD"
|
||||
|
||||
(( ! "${+paths##\|}" )) && return # stop if we have nothing to add
|
||||
[ -z "${paths##\|}" ] && return # stop if we have nothing to add
|
||||
|
||||
# maintain the file
|
||||
local tempfile
|
||||
|
@ -312,12 +312,12 @@ $(fasd --backend $each)"
|
|||
while [ "$1" ]; do case $1 in
|
||||
--complete) [ "$2" = "--" ] && shift; set -- $2; local lst=1 r=r comp=1;;
|
||||
--query|--add|--delete|-A|-D) fasd "$@"; return $?;;
|
||||
--version) (( ! "${+comp}" )) && echo "1.0.1" && return;;
|
||||
--version) [ -z "$comp" ] && echo "1.0.1" && return;;
|
||||
--) while [ "$2" ]; do shift; fnd="$fnd $1"; last="$1"; done;;
|
||||
-*) local o="${1#-}"; while [ "$o" ]; do case $o in
|
||||
s*) local show=1;;
|
||||
l*) local lst=1;;
|
||||
i*) (( ! "${+comp}" )) && local interactive=1 show=1;;
|
||||
i*) [ -z "$comp" ] && local interactive=1 show=1;;
|
||||
r*) local mode=rank;;
|
||||
t*) local mode=recent;;
|
||||
e*) o="${o#?}"; if [ "$o" ]; then # there are characters after "-e"
|
||||
|
@ -343,7 +343,7 @@ $(fasd --backend $each)"
|
|||
f*) local typ=f;;
|
||||
R*) local r=r;;
|
||||
[0-9]*) local _fasd_i="$o"; break;;
|
||||
h*) (( ! "${+comp}" )) && echo "fasd [options] [query ...]
|
||||
h*) [ -z "$comp" ] && echo "fasd [options] [query ...]
|
||||
[f|a|s|d|z] [options] [query ...]
|
||||
options:
|
||||
-s list paths with scores
|
||||
|
@ -376,7 +376,7 @@ fasd [-A|-D] [paths ...]
|
|||
fi;;
|
||||
esac
|
||||
|
||||
local R; (( ! "${+r}" )) && R=r || R= # let $R be the opposite of $r
|
||||
local R; [ -z "$r" ] && R=r || R= # let $R be the opposite of $r
|
||||
fnd="${fnd# }"
|
||||
|
||||
local res
|
||||
|
@ -407,7 +407,7 @@ fasd [-A|-D] [paths ...]
|
|||
fi
|
||||
if [ "$res" ]; then
|
||||
fasd --add "$res"
|
||||
(( ! "${+exec}" )) && exec='printf %s\n'
|
||||
[ -z "$exec" ] && exec='printf %s\n'
|
||||
$exec "$res"
|
||||
fi
|
||||
;;
|
||||
|
|
|
@ -6,7 +6,7 @@ fasd_cd() {
|
|||
fasd "$@"
|
||||
else
|
||||
local _fasd_ret="$(fasd -e 'printf %s' "$@")"
|
||||
(( ! "${+_fasd_ret}" )) && return
|
||||
[ -z "$_fasd_ret" ] && return
|
||||
[ -d "$_fasd_ret" ] && cd "$_fasd_ret" || printf %s\n "$_fasd_ret"
|
||||
fi
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ compctl -U -K _fasd_zsh_cmd_complete -V fasd -x 'C[-1,-*e],s[-]n[1,e]' -c - \
|
|||
# zsh word mode completion
|
||||
_fasd_zsh_word_complete() {
|
||||
[ "$2" ] && local _fasd_cur="$2"
|
||||
(( ! "${+_fasd_cur}" )) && local _fasd_cur="${words[CURRENT]}"
|
||||
[ -z "$_fasd_cur" ] && local _fasd_cur="${words[CURRENT]}"
|
||||
local fnd="${_fasd_cur//,/ }"
|
||||
local typ=${1:-e}
|
||||
fasd --query $typ "$fnd" 2>> "/dev/null" | \
|
||||
|
|
|
@ -12,7 +12,7 @@ local url
|
|||
|
||||
url="$(command git config --file "$(git-root)/.gitmodules" --get "submodule.${src}.url")"
|
||||
|
||||
if (( ! "${+url}" )); then
|
||||
if [[ -z "${url}" ]]; then
|
||||
print "${0}: submodule not found: ${src}" >&2
|
||||
return 1
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue