From fe553585e9fd0af83d471236e939b399206919dd Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Fri, 31 Dec 2021 04:51:31 +0530 Subject: [PATCH] Use -- with cd so paths aren't treated as options --- templates/bash.txt | 2 +- templates/zsh.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 }}