mirror of
				https://github.com/wting/autojump
				synced 2025-06-13 12:54:07 +00:00 
			
		
		
		
	Merge pull request #311 from joelthelion/fix-j-dashdash-issue-310
RFC: Handle `j -- -foo` (for bash and zsh only)
This commit is contained in:
		
						commit
						b4cbcc2fd2
					
				@ -60,7 +60,7 @@ from autojump_utils import sanitize
 | 
			
		||||
from autojump_utils import take
 | 
			
		||||
from autojump_utils import unico
 | 
			
		||||
 | 
			
		||||
VERSION = '22.1.1-beta'
 | 
			
		||||
VERSION = '22.2.0-beta'
 | 
			
		||||
FUZZY_MATCH_THRESHOLD = 0.6
 | 
			
		||||
TAB_ENTRIES_COUNT = 9
 | 
			
		||||
TAB_SEPARATOR = '__'
 | 
			
		||||
 | 
			
		||||
@ -54,7 +54,7 @@ esac
 | 
			
		||||
 | 
			
		||||
# default autojump command
 | 
			
		||||
j() {
 | 
			
		||||
    if [[ ${@} =~ ^-{1,2}.* ]]; then
 | 
			
		||||
    if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
 | 
			
		||||
        autojump ${@}
 | 
			
		||||
        return
 | 
			
		||||
    fi
 | 
			
		||||
@ -74,8 +74,9 @@ j() {
 | 
			
		||||
 | 
			
		||||
# jump to child directory (subdirectory of current path)
 | 
			
		||||
jc() {
 | 
			
		||||
    if [[ ${@} == -* ]]; then
 | 
			
		||||
    if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
 | 
			
		||||
        autojump ${@}
 | 
			
		||||
        return
 | 
			
		||||
    else
 | 
			
		||||
        j $(pwd) ${@}
 | 
			
		||||
    fi
 | 
			
		||||
@ -84,7 +85,7 @@ jc() {
 | 
			
		||||
 | 
			
		||||
# open autojump results in file browser
 | 
			
		||||
jo() {
 | 
			
		||||
    if [[ ${@} == -* ]]; then
 | 
			
		||||
    if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
 | 
			
		||||
        autojump ${@}
 | 
			
		||||
        return
 | 
			
		||||
    fi
 | 
			
		||||
@ -116,8 +117,9 @@ jo() {
 | 
			
		||||
 | 
			
		||||
# open autojump results (child directory) in file browser
 | 
			
		||||
jco() {
 | 
			
		||||
    if [[ ${@} == -* ]]; then
 | 
			
		||||
    if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
 | 
			
		||||
        autojump ${@}
 | 
			
		||||
        return
 | 
			
		||||
    else
 | 
			
		||||
        jo $(pwd) ${@}
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
@ -44,7 +44,7 @@ chpwd_functions+=autojump_chpwd
 | 
			
		||||
 | 
			
		||||
# default autojump command
 | 
			
		||||
j() {
 | 
			
		||||
    if [[ ${@} == -* ]]; then
 | 
			
		||||
    if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
 | 
			
		||||
        autojump ${@}
 | 
			
		||||
        return
 | 
			
		||||
    fi
 | 
			
		||||
@ -65,8 +65,9 @@ j() {
 | 
			
		||||
 | 
			
		||||
# jump to child directory (subdirectory of current path)
 | 
			
		||||
jc() {
 | 
			
		||||
    if [[ ${@} == -* ]]; then
 | 
			
		||||
    if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
 | 
			
		||||
        autojump ${@}
 | 
			
		||||
        return
 | 
			
		||||
    else
 | 
			
		||||
        j $(pwd) ${@}
 | 
			
		||||
    fi
 | 
			
		||||
@ -75,7 +76,7 @@ jc() {
 | 
			
		||||
 | 
			
		||||
# open autojump results in file browser
 | 
			
		||||
jo() {
 | 
			
		||||
    if [[ ${@} == -* ]]; then
 | 
			
		||||
    if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
 | 
			
		||||
        autojump ${@}
 | 
			
		||||
        return
 | 
			
		||||
    fi
 | 
			
		||||
@ -108,8 +109,9 @@ jo() {
 | 
			
		||||
 | 
			
		||||
# open autojump results (child directory) in file browser
 | 
			
		||||
jco() {
 | 
			
		||||
    if [[ ${@} == -* ]]; then
 | 
			
		||||
    if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
 | 
			
		||||
        autojump ${@}
 | 
			
		||||
        return
 | 
			
		||||
    else
 | 
			
		||||
        jo $(pwd) ${@}
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user