From a29aa44183582d268ee2952e4eea050d0c96e1d1 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Fri, 18 Aug 2023 17:13:08 +0200 Subject: [PATCH] functions: Fix command name This was "function", needs to be "function*s*". It was only an issue in the option parsing because we set cmd there again instead of passing it. Maybe these should just be file-level constants? --- fish-rust/src/builtins/functions.rs | 2 +- tests/checks/functions.fish | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/fish-rust/src/builtins/functions.rs b/fish-rust/src/builtins/functions.rs index bbbdf6116..57a2f3746 100644 --- a/fish-rust/src/builtins/functions.rs +++ b/fish-rust/src/builtins/functions.rs @@ -71,7 +71,7 @@ fn parse_cmd_opts<'args>( parser: &mut parser_t, streams: &mut io_streams_t, ) -> Option { - let cmd = L!("function"); + let cmd = L!("functions"); let print_hints = false; let mut w = wgetopter_t::new(SHORT_OPTIONS, LONG_OPTIONS, argv); while let Some(opt) = w.wgetopt_long() { diff --git a/tests/checks/functions.fish b/tests/checks/functions.fish index 2d4d35154..4ed058ea7 100644 --- a/tests/checks/functions.fish +++ b/tests/checks/functions.fish @@ -224,3 +224,8 @@ functions --details --verbose thisfunctiondoesnotexist # CHECK: 0 # CHECK: n/a # CHECK: n/a + +functions --banana +# CHECKERR: functions: --banana: unknown option +echo $status +# CHECK: 2