1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

Add --child support to shell scripts.

This commit is contained in:
Léo Peltier 2015-07-23 12:17:19 +02:00
parent 971303bcde
commit 9f0826dcf9
3 changed files with 10 additions and 20 deletions

View File

@ -79,10 +79,10 @@ j() {
# jump to child directory (subdirectory of current path) # jump to child directory (subdirectory of current path)
jc() { jc() {
if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
autojump ${@} autojump --child ${@}
return return
else else
j $(pwd) ${@} j ${@} --child
fi fi
} }
@ -122,9 +122,9 @@ jo() {
# open autojump results (child directory) in file browser # open autojump results (child directory) in file browser
jco() { jco() {
if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
autojump ${@} autojump --child ${@}
return return
else else
jo $(pwd) ${@} jo ${@} --child
fi fi
} }

View File

@ -70,12 +70,7 @@ end
# jump to child directory (subdirectory of current path) # jump to child directory (subdirectory of current path)
function jc function jc
switch "$argv" j $argv --child
case '-*'
j $argv
case '*'
j (pwd) $argv
end
end end
@ -103,10 +98,5 @@ end
# open autojump results (child directory) in file browser # open autojump results (child directory) in file browser
function jco function jco
switch "$argv" jo $argv --child
case '-*'
j $argv
case '*'
jo (pwd) $argv
end
end end

View File

@ -73,10 +73,10 @@ j() {
# jump to child directory (subdirectory of current path) # jump to child directory (subdirectory of current path)
jc() { jc() {
if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
autojump ${@} autojump --child ${@}
return return
else else
j $(pwd) ${@} j ${@} --child
fi fi
} }
@ -117,9 +117,9 @@ jo() {
# open autojump results (child directory) in file browser # open autojump results (child directory) in file browser
jco() { jco() {
if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
autojump ${@} autojump --child ${@}
return return
else else
jo $(pwd) ${@} jo ${@} --child
fi fi
} }