Clarify that the variable/mode *name* is invalid

When you do

```fish
set foo-bar baz
```

"foo-baz" isn't usable as a variable *name*. When you just say the
"variable" is invalid that could also be interpreted to be a special
type of variable or something.
This commit is contained in:
Fabian Homborg 2022-04-08 16:36:06 +02:00
parent 789b2010f5
commit 31e2476fc8
3 changed files with 8 additions and 8 deletions

View file

@ -60,10 +60,10 @@ struct builtin_data_t {
#define BUILTIN_ERR_MAX_ARG_COUNT1 _(L"%ls: expected <= %d arguments; got %d\n")
/// Error message for invalid variable name.
#define BUILTIN_ERR_VARNAME _(L"%ls: %ls: invalid variable. See `help identifiers`\n")
#define BUILTIN_ERR_VARNAME _(L"%ls: %ls: invalid variable name. See `help identifiers`\n")
/// Error message for invalid bind mode name.
#define BUILTIN_ERR_BIND_MODE _(L"%ls: %ls: invalid mode. See `help identifiers`\n")
#define BUILTIN_ERR_BIND_MODE _(L"%ls: %ls: invalid mode name. See `help identifiers`\n")
/// Error message when too many arguments are supplied to a builtin.
#define BUILTIN_ERR_TOO_MANY_ARGUMENTS _(L"%ls: too many arguments\n")

View file

@ -5,11 +5,11 @@
# Verify that an invalid bind mode is rejected. >&2
bind -m 'bad bind mode' \cX true
# CHECKERR: bind: bad bind mode: invalid mode. See `help identifiers`
# CHECKERR: bind: bad bind mode: invalid mode name. See `help identifiers`
# Verify that an invalid bind mode target is rejected. >&2
bind -M bind-mode \cX true
# CHECKERR: bind: bind-mode: invalid mode. See `help identifiers`
# CHECKERR: bind: bind-mode: invalid mode name. See `help identifiers`
# CHECKERR: bind: No binding found for sequence '\t'
# This should succeed and result in a success, zero, status.

View file

@ -471,7 +471,7 @@ env | grep __fish_empty_uvar
for a,b in y 1 z 3
echo $a,$b
end
# CHECKERR: {{.*}} for: a,b: invalid variable. See `help identifiers`
# CHECKERR: {{.*}} for: a,b: invalid variable name. See `help identifiers`
# CHECKERR: for a,b in y 1 z 3
# CHECKERR: ^
@ -530,7 +530,7 @@ sh -c "EDITOR='vim -g' $FISH -c "'\'set -S EDITOR\'' | string match -r -e 'globa
# Verify behavior of `set --show` given an invalid var name
set --show 'argle bargle'
#CHECKERR: set: argle bargle: invalid variable. See `help identifiers`
#CHECKERR: set: argle bargle: invalid variable name. See `help identifiers`
#CHECKERR: {{.*}}set.fish (line {{\d+}}):
#CHECKERR: set --show 'argle bargle'
#CHECKERR: ^
@ -757,14 +757,14 @@ echo $status
true
set "" foo
#CHECKERR: set: : invalid variable. See `help identifiers`
#CHECKERR: set: : invalid variable name. See `help identifiers`
#CHECKERR: {{.*}}set.fish (line {{\d+}}):
#CHECKERR: set "" foo
#CHECKERR: ^
#CHECKERR: (Type 'help set' for related documentation)
set --show ""
#CHECKERR: set: : invalid variable. See `help identifiers`
#CHECKERR: set: : invalid variable name. See `help identifiers`
#CHECKERR: {{.*}}set.fish (line {{\d+}}):
#CHECKERR: set --show ""
#CHECKERR: ^