fish-shell/fish-rust
Fabian Boehm 4d2f7b0c0d
ast: Require --help to parse more keywords as decorated statement (#10000)
This makes it so

```fish
if -e foo
    # do something
end
```

complains about `-e` not being a command instead of `end` being used
outside of an if-block.

That means both that `-e` could now be used as a command name (it
already can outside of `if`!) *and* that we get a better error!

The only way to get `if` to be a decorated statement now is to use `if
-h` or `if --help` specifically (with a literal option).

The same goes for switch, while and begin.

It would be possible, alternatively, to disallow `if -e` and point
towards using `test` instead, but the "unknown command" message should
already point towards using `test` more than pointing at the
"end" (that might be quite far away).
2023-09-19 17:34:13 +02:00
..
src ast: Require --help to parse more keywords as decorated statement (#10000) 2023-09-19 17:34:13 +02:00
widestring-suffix Move edition and MSRV to workspace 2023-08-19 15:18:38 +02:00
build.rs Port the easy part of wildcard.{h,cpp} 2023-09-15 14:38:30 +02:00