From a92804a8a1b47dc6649fa01ef07571aa439a0ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20H=C3=B8rl=C3=BCck=20Berg?= <36937807+henrikhorluck@users.noreply.github.com> Date: Fri, 18 Aug 2023 07:08:31 +0200 Subject: [PATCH] Port MISSING_HELP and MISSING (arg) C++ main used getopt (no w!), which appears to internally print error-messages. The Rust version will use `wgetopter_t`, and therefore needs to print this itself. --- fish-rust/src/builtins/shared.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fish-rust/src/builtins/shared.rs b/fish-rust/src/builtins/shared.rs index 661992fe5..6f0cbaea0 100644 --- a/fish-rust/src/builtins/shared.rs +++ b/fish-rust/src/builtins/shared.rs @@ -59,6 +59,9 @@ unsafe impl ExternType for io_streams_t { /// Error message for unknown switch. pub const BUILTIN_ERR_UNKNOWN: &str = "%ls: %ls: unknown option\n"; +pub const BUILTIN_ERR_MISSING_HELP: &str = "fish: %ls: missing man page\nDocumentation may not be installed.\n`help %ls` will show an online version\n"; +pub const BUILTIN_ERR_MISSING: &str = "%ls: %ls: option requires an argument\n"; + /// Error messages for unexpected args. pub const BUILTIN_ERR_ARG_COUNT0: &str = "%ls: missing argument\n"; pub const BUILTIN_ERR_ARG_COUNT1: &str = "%ls: expected %d arguments; got %d\n";