mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 17:43:44 +08:00
51468b7646
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
26 lines
344 B
Plaintext
26 lines
344 B
Plaintext
Testing -V
|
|
$foo: (1)
|
|
1: 'local foo'
|
|
$bar: (5)
|
|
1: 'one'
|
|
2: 'two 2'
|
|
3: ' '
|
|
4: ''
|
|
5: '3'
|
|
$baz: (0)
|
|
Testing -V with changed variables
|
|
$foo: (1)
|
|
1: 'local foo'
|
|
$bar: (5)
|
|
1: 'one'
|
|
2: 'two 2'
|
|
3: ' '
|
|
4: ''
|
|
5: '3'
|
|
$baz: (0)
|
|
Function name1 found
|
|
Function name2 found
|
|
Function name3 found
|
|
Function name4 found
|
|
"function pwd --shadow-builtin" worked
|