function: Check if --argument-names gets a valid variable name

These were accepted but then ineffective because the only way these
are used is to set a variable.
This commit is contained in:
Fabian Boehm
2024-05-06 16:54:20 +02:00
parent 39b996332e
commit 2a121ef1aa
2 changed files with 15 additions and 0 deletions

View File

@@ -167,4 +167,10 @@ function foo -p bar; end
# CHECKERR: function foo -p bar; end
# CHECKERR: ^~~~~~~~~~~~~~~~~~~^
function foo --argument-names "banana pajama"; end
# CHECKERR: {{.*}}function.fish (line {{\d+}}): function: banana pajama: invalid variable name. See `help identifiers`
# CHECKERR: function foo --argument-names "banana pajama"; end
# CHECKERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
exit 0