Revert accidentally pushed fork

Revert "README for this fork"

This reverts commit 97db461e7f.

Revert "Allow foo=bar global variable assignments"

This reverts commit 45a2017580.

Revert "Interpret () in command position as subshell"

This reverts commit 0199583435.

Revert "Allow special variables $?,$$,$@,$#"

This reverts commit 4a71ee1288.

Revert "Allow $() in command position"

This reverts commit 4b99fe2288.

Revert "Turn off full LTO"

This reverts commit b1213f1385.

Revert "Back out "bind: Remove "c-" and "a-" shortcut notation""

This reverts commit f43abc42f9.

Revert "Un-hide documentation of non-fish shell builtins"

This reverts commit 485201ba2e.
This commit is contained in:
Fabian Boehm
2025-01-19 18:34:42 +01:00
parent 97db461e7f
commit 494bdfa013
27 changed files with 469 additions and 451 deletions

View File

@@ -16,6 +16,7 @@ or echo Invalid $status
commandline --input 'echo $$' --is-valid
or echo Invalid $status
# CHECK: Invalid 1
commandline --help &>/dev/null
echo Help $status

View File

@@ -324,8 +324,11 @@ $fish -c 'echo {}}'
#CHECKERR: fish: Unexpected '}' for unopened brace
#CHECKERR: echo {}}
#CHECKERR: ^
printf '<%s>\n' ($fish -c 'command (echo asd)' 2>&1)
# CHECK: <asd>
printf '<%s>\n' ($fish -c 'command (asd)' 2>&1)
#CHECK: <fish: command substitutions not allowed in command position. Try var=(your-cmd) $var ...>
#CHECK: <command (asd)>
#CHECK: < ^~~~^>
true
printf '<%s>\n' ($fish -c 'echo "$abc["' 2>&1)
#CHECK: <fish: Invalid index value>
@@ -334,7 +337,7 @@ printf '<%s>\n' ($fish -c 'echo "$abc["' 2>&1)
set -l pager command less
echo foo | $pager
#CHECKERR: {{.*}}checks/expansion.fish (line {{\d+}}): The expanded command is a keyword.
#CHECKERR: {{.*}}checks/expansion.fish (line 339): The expanded command is a keyword.
#CHECKERR: echo foo | $pager
#CHECKERR: ^~~~~^

View File

@@ -403,7 +403,8 @@ function hello_continuations
echo "\
a=1 \\
a=2 echo" | $fish_indent --check # FIXME
a=2 \\
echo" | $fish_indent --check
echo $status #CHECK: 0
echo "\
@@ -496,12 +497,12 @@ echo $status #CHECK: 0
echo 'PATH={$PATH[echo " "' | $fish_indent --ansi
# CHECK: PATH={$PATH[echo " "
echo a \> | $fish_indent # TODO(posix_mode)
echo a\> | $fish_indent
# CHECK: a >
echo a\<\) | $fish_indent
# CHECK: a < )
echo b\|\{ | $fish_indent # TODO(posix_mode)
echo b\|\{ | $fish_indent
# CHECK: b | {
echo "\'\\\\\x00\'" | string unescape | $fish_indent | string escape

View File

@@ -91,20 +91,20 @@ $fish --no-config -c 'echo notprinted; echo foo | exec true; echo banana'
# CHECKERR: ^~~~~~~~^
# Running multiple command lists continues even if one has a syntax error.
$fish --no-config -c 'echo $% oh no syntax error' -c 'echo this works'
$fish --no-config -c 'echo $$ oh no syntax error' -c 'echo this works'
# CHECK: this works
# CHECKERR: fish: $% is not a valid variable in fish.
# CHECKERR: echo $% oh no syntax error
# CHECKERR: fish: $$ is not the pid. In fish, please use $fish_pid.
# CHECKERR: echo $$ oh no syntax error
# CHECKERR: ^
$fish --no-config .
# CHECKERR: error: Unable to read input file: Is a directory
# CHECKERR: warning: Error while reading file .
$fish --no-config -c 'echo notprinted; echo foo; echo $%'
# CHECKERR: fish: $% is not a valid variable in fish.
# CHECKERR: echo notprinted; echo foo; echo $%
# CHECKERR: ^
$fish --no-config -c 'echo notprinted; echo foo; a=b'
# CHECKERR: fish: Unsupported use of '='. In fish, please use 'set a b'.
# CHECKERR: echo notprinted; echo foo; a=b
# CHECKERR: ^~^
$fish --no-config -c 'echo notprinted | and true'
# CHECKERR: fish: The 'and' command can not be used in a pipeline

View File

@@ -17,6 +17,18 @@ echo 'true | time false' | $fish 2>| string replace -r '(.*)' '<$1>'
# CHECK: < ^~~~~~~~~^>
echo '
FOO=BAR (true one)
(true two)
# more things
' | $fish 2>| string replace -r '(.*)' '<$1>'
# CHECK: <fish: command substitutions not allowed in command position. Try var=(your-cmd) $var ...>
# CHECK: <FOO=BAR (true one)>
# CHECK: < ^~~~~~~~~^>
$fish -c 'echo "unfinished "(subshell' 2>| string replace -r '.*' '<$0>'
# CHECK: <fish: Unexpected end of string, expecting ')'>
# CHECK: <echo "unfinished "(subshell>

View File

@@ -85,19 +85,18 @@ complete -C'a=b envxalias '
# CHECK: arg
# Eval invalid grammar to allow fish to parse this file
a=(echo b1)
echo a is $a
# CHECK: a is b1
# FIXME
# : | a=b2
# echo a is $a
# # CHECK: echo a is b2
# TODO(posix_mode)
# not a=b3
# echo a is $a
# # CHECK: echo a is b3
eval 'a=(echo b)'
# CHECKERR: {{.*}}: Unsupported use of '='. In fish, please use 'set a (echo b)'.
# CHECKERR: a=(echo b)
# CHECKERR: ^~~~~~~~~^
eval ': | a=b'
# CHECKERR: {{.*}}: Unsupported use of '='. In fish, please use 'set a b'.
# CHECKERR: : | a=b
# CHECKERR: ^~^
eval 'not a=b'
# CHECKERR: {{.*}}: Unsupported use of '='. In fish, please use 'set a b'.
# CHECKERR: not a=b
# CHECKERR: ^~^
complete -c foo -xa '$a'
a=b complete -C'foo '