Allow variables in commands

Syntax highlighting for these coming in next commit.

Fixes #154
This commit is contained in:
ridiculousfish
2018-08-26 01:41:45 -07:00
parent 59d78e8afa
commit 865a4647ae
10 changed files with 133 additions and 55 deletions

View File

@@ -1,6 +1,6 @@
fish: Variables may not be used as commands. In fish, please define a function or use 'eval $test'.
exec $test
^
fish: Variables may not be used as commands. In fish, please define a function or use 'eval "$test"'.
exec "$test"
^
fish: The expanded command was empty.
$EMPTY_VARIABLE
^
fish: The expanded command was empty.
"$EMPTY_VARIABLE"
^

View File

@@ -1,8 +1,16 @@
# Test that using variables as command names work correctly.
# Both of these should generate errors about using variables as command names.
# Verify that the expected errors are written to stderr.
exec $test
exec "$test"
$EMPTY_VARIABLE
"$EMPTY_VARIABLE"
set CMD1 echo basic command as variable
$CMD1
set CMD2 echo '(' not expanded again
$CMD2
# Test implicit cd
set CMD3 /usr/bin
$CMD3 && echo $PWD
exit 0

View File

@@ -0,0 +1,3 @@
basic command as variable
( not expanded again
/usr/bin