From 210e7a9cc989d18fc4b62a0328451cef39770fbc Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Wed, 9 Feb 2022 08:52:52 +0100 Subject: [PATCH] Correct error on when complete -C is used without argument The new --escape option means that -C is not necessarily the last option; We have this scenario where we produce a bogus error $ fish -c 'complete -C --escape' complete: --escape: option requires an argument --escape doesn't take arguments, so let the error message say -C. --- src/builtins/complete.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/builtins/complete.cpp b/src/builtins/complete.cpp index b3e606937..a25b90438 100644 --- a/src/builtins/complete.cpp +++ b/src/builtins/complete.cpp @@ -357,7 +357,7 @@ maybe_t builtin_complete(parser_t &parser, io_streams_t &streams, const wch if (!state.initialized) { // This corresponds to using 'complete -C' in non-interactive mode. // See #2361 . - builtin_missing_argument(parser, streams, cmd, argv[w.woptind - 1]); + builtin_missing_argument(parser, streams, cmd, L"-C"); return STATUS_INVALID_ARGS; } do_complete_param = std::move(state.text);