mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-27 00:21:15 -03:00
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.
This commit is contained in:
@@ -357,7 +357,7 @@ maybe_t<int> 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);
|
||||
|
||||
Reference in New Issue
Block a user