mirror of
				https://github.com/wting/autojump
				synced 2025-06-13 12:54:07 +00:00 
			
		
		
		
	Add --child support to shell scripts.
This commit is contained in:
		
							parent
							
								
									971303bcde
								
							
						
					
					
						commit
						9f0826dcf9
					
				@ -79,10 +79,10 @@ j() {
 | 
			
		||||
# jump to child directory (subdirectory of current path)
 | 
			
		||||
jc() {
 | 
			
		||||
    if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
 | 
			
		||||
        autojump ${@}
 | 
			
		||||
        autojump --child ${@}
 | 
			
		||||
        return
 | 
			
		||||
    else
 | 
			
		||||
        j $(pwd) ${@}
 | 
			
		||||
        j ${@} --child
 | 
			
		||||
    fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -122,9 +122,9 @@ jo() {
 | 
			
		||||
# open autojump results (child directory) in file browser
 | 
			
		||||
jco() {
 | 
			
		||||
    if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
 | 
			
		||||
        autojump ${@}
 | 
			
		||||
        autojump --child ${@}
 | 
			
		||||
        return
 | 
			
		||||
    else
 | 
			
		||||
        jo $(pwd) ${@}
 | 
			
		||||
        jo ${@} --child
 | 
			
		||||
    fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -70,12 +70,7 @@ end
 | 
			
		||||
 | 
			
		||||
# jump to child directory (subdirectory of current path)
 | 
			
		||||
function jc
 | 
			
		||||
    switch "$argv"
 | 
			
		||||
        case '-*'
 | 
			
		||||
            j $argv
 | 
			
		||||
        case '*'
 | 
			
		||||
            j (pwd) $argv
 | 
			
		||||
    end
 | 
			
		||||
    j $argv --child
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -103,10 +98,5 @@ end
 | 
			
		||||
 | 
			
		||||
# open autojump results (child directory) in file browser
 | 
			
		||||
function jco
 | 
			
		||||
    switch "$argv"
 | 
			
		||||
        case '-*'
 | 
			
		||||
            j $argv
 | 
			
		||||
        case '*'
 | 
			
		||||
            jo (pwd) $argv
 | 
			
		||||
    end
 | 
			
		||||
    jo $argv --child
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@ -73,10 +73,10 @@ j() {
 | 
			
		||||
# jump to child directory (subdirectory of current path)
 | 
			
		||||
jc() {
 | 
			
		||||
    if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
 | 
			
		||||
        autojump ${@}
 | 
			
		||||
        autojump --child ${@}
 | 
			
		||||
        return
 | 
			
		||||
    else
 | 
			
		||||
        j $(pwd) ${@}
 | 
			
		||||
        j ${@} --child
 | 
			
		||||
    fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -117,9 +117,9 @@ jo() {
 | 
			
		||||
# open autojump results (child directory) in file browser
 | 
			
		||||
jco() {
 | 
			
		||||
    if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
 | 
			
		||||
        autojump ${@}
 | 
			
		||||
        autojump --child ${@}
 | 
			
		||||
        return
 | 
			
		||||
    else
 | 
			
		||||
        jo $(pwd) ${@}
 | 
			
		||||
        jo ${@} --child
 | 
			
		||||
    fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user