Skip to content

Error message of the test command #6030

@Bost

Description

@Bost

Hi. Suppose there's an erroneous expression (forgotten semicolons):

> test 1 = 2 and echo true or echo false
test: Expected a combining operator like '-a' at index 3

Then it's unclear what is index 3, especially if you're not sure if the indexing starts at 0 or 1 [1]. I'd propose a better message:
test: Expected a combining operator like '-a', found ...

Thanx

[1]: I.e. are parameters of the test treated as a fish-specific list or does it come from C++ or python code?

> fish --version
fish, version 3.0.2
> echo $version 
3.0.2

> uname -a
Linux martin 5.0.0-23-generic #24-Ubuntu SMP Mon Jul 29 15:36:44 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
> echo $TERM 
xterm-256color
> sh -c 'env HOME=$(mktemp -d) fish'
Welcome to fish, the friendly interactive shell

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions