diff --git a/templates/bash.txt b/templates/bash.txt index 8aff54f..88fb9a2 100644 --- a/templates/bash.txt +++ b/templates/bash.txt @@ -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 }} diff --git a/templates/zsh.txt b/templates/zsh.txt index 6f01d24..bc585f4 100644 --- a/templates/zsh.txt +++ b/templates/zsh.txt @@ -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 }}