Use -- with cd so paths aren't treated as options

This commit is contained in:
Ajeet D'Souza 2021-12-31 04:51:31 +05:30
parent 027d259c89
commit fe553585e9
2 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@ function __zoxide_pwd() {
# cd + custom logic based on the value of _ZO_ECHO.
function __zoxide_cd() {
# shellcheck disable=SC2164
\builtin cd "$@" {%- if echo %} && __zoxide_pwd {%- endif %}
\builtin cd -- "$@" {%- if echo %} && __zoxide_pwd {%- endif %}
}
{{ section }}

View File

@ -17,7 +17,7 @@ function __zoxide_pwd() {
# cd + custom logic based on the value of _ZO_ECHO.
function __zoxide_cd() {
# shellcheck disable=SC2164
\builtin cd "$@" {%- if echo %} && __zoxide_pwd {%- endif %}
\builtin cd -- "$@" {%- if echo %} && __zoxide_pwd {%- endif %}
}
{{ section }}