aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/cd.fish
diff options
context:
space:
mode:
authorGravatar Kurtis Rader <krader@skepticism.us>2016-05-08 15:57:56 -0700
committerGravatar Kurtis Rader <krader@skepticism.us>2016-05-14 20:38:32 -0700
commit51468b764689e7d724a87e6c2b8cdb4e599a3604 (patch)
tree75fe13dbad791e0d143a3610bfe7ed7d0136ad38 /share/functions/cd.fish
parentff1d651415a2752e82ec417294f9bdf8c234c10f (diff)
add `function --shadow-builtin` flag
It's currently too easy for someone to bork their shell by doing something like `function test; return 0; end`. That's obviously a silly, contrived, example but the point is that novice users who learn about functions are prone to do something like that without realizing it will bork the shell. Even expert users who know about the `test` builtin might forget that, say, `pwd` is a builtin. This change adds a `--shadow-builtin` flag that must be specified to indicate you know what you're doing. Fixes #3000
Diffstat (limited to 'share/functions/cd.fish')
-rw-r--r--share/functions/cd.fish2
1 files changed, 1 insertions, 1 deletions
diff --git a/share/functions/cd.fish b/share/functions/cd.fish
index adf0327c..fdc8b607 100644
--- a/share/functions/cd.fish
+++ b/share/functions/cd.fish
@@ -1,7 +1,7 @@
#
# Wrap the builtin cd command to maintain directory history.
#
-function cd --description "Change directory"
+function cd --shadow-builtin --description "Change directory"
set -l MAX_DIR_HIST 25
if test (count $argv) -gt 1