1
0
mirror of https://github.com/wting/autojump synced 2026-03-02 03:49:26 +00:00

Update scripts to use version agnostic pattern matching and corresponding documentation.

This commit is contained in:
William Ting
2012-05-27 13:14:01 -10:00
parent 1b765ab8a6
commit 183fa795d7
4 changed files with 12 additions and 14 deletions

View File

@@ -35,17 +35,10 @@ typeset -ga preexec_functions
preexec_functions+=autojump_preexec
function j {
if is-at-least 4.3.5; then
if [[ ${@} =~ -.* ]]; then
autojump ${@}
return
fi
else
if [[ ${@} -pcre-match -.* ]]; then
autojump ${@}
return
fi
fi
if [[ ${@} == -* ]]; then
autojump ${@}
return
fi
local new_path="$(autojump $@)"
if [ -d "${new_path}" ]; then