mirror of
https://github.com/Llewellynvdm/zoxide.git
synced 2025-01-28 09:38:30 +00:00
Support z -- dir
for zsh and fish (#858)
This commit is contained in:
parent
8da8f50eaa
commit
d655e026f5
@ -82,6 +82,8 @@ function __zoxide_z
|
|||||||
__zoxide_cd -
|
__zoxide_cd -
|
||||||
else if test $argc -eq 1 -a -d $argv[1]
|
else if test $argc -eq 1 -a -d $argv[1]
|
||||||
__zoxide_cd $argv[1]
|
__zoxide_cd $argv[1]
|
||||||
|
else if test $argc -eq 2 -a $argv[1] = --
|
||||||
|
__zoxide_cd -- $argv[2]
|
||||||
else if set -l result (string replace --regex -- $__zoxide_z_prefix_regex '' $argv[-1]); and test -n $result
|
else if set -l result (string replace --regex -- $__zoxide_z_prefix_regex '' $argv[-1]); and test -n $result
|
||||||
__zoxide_cd $result
|
__zoxide_cd $result
|
||||||
else
|
else
|
||||||
|
@ -59,6 +59,8 @@ function __zoxide_z() {
|
|||||||
__zoxide_cd ~
|
__zoxide_cd ~
|
||||||
elif [[ "$#" -eq 1 ]] && { [[ -d "$1" ]] || [[ "$1" = '-' ]] || [[ "$1" =~ ^[-+][0-9]$ ]]; }; then
|
elif [[ "$#" -eq 1 ]] && { [[ -d "$1" ]] || [[ "$1" = '-' ]] || [[ "$1" =~ ^[-+][0-9]$ ]]; }; then
|
||||||
__zoxide_cd "$1"
|
__zoxide_cd "$1"
|
||||||
|
elif [[ "$#" -eq 2 ]] && [[ "$1" = "--" ]]; then
|
||||||
|
__zoxide_cd "$2"
|
||||||
else
|
else
|
||||||
\builtin local result
|
\builtin local result
|
||||||
# shellcheck disable=SC2312
|
# shellcheck disable=SC2312
|
||||||
|
Loading…
x
Reference in New Issue
Block a user