From fb2caf63e5b9db9470cd616856192fed9d908b70 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Fri, 17 Jan 2025 09:52:53 +0100 Subject: [PATCH] Fix error for "fish --foo" without option argument Wgetopt needs a ":" at the beginning to turn on this type of error. I'm not sure why that is now, and we might want to change it (but tbh wgetopt could do with a replacement anyway). Fixes #11049 --- src/bin/fish.rs | 2 +- tests/checks/invocation.fish | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bin/fish.rs b/src/bin/fish.rs index 91fdc5165..7ab4cc3d6 100644 --- a/src/bin/fish.rs +++ b/src/bin/fish.rs @@ -528,7 +528,7 @@ fn fish_parse_opt(args: &mut [WString], opts: &mut FishCmdOpts) -> ControlFlow] = &[ wopt(L!("command"), RequiredArgument, 'c'), wopt(L!("init-command"), RequiredArgument, 'C'), diff --git a/tests/checks/invocation.fish b/tests/checks/invocation.fish index 2c16b10cc..623bdf6ac 100644 --- a/tests/checks/invocation.fish +++ b/tests/checks/invocation.fish @@ -111,5 +111,8 @@ $fish --no-config -c 'echo notprinted | and true' # CHECKERR: echo notprinted | and true # CHECKERR: ^~^ +$fish --no-config --features +# CHECKERR: fish: --features: option requires an argument + # Regression test for a hang. echo "set -L" | $fish > /dev/null