mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
parent
31d1e04301
commit
025b45b91e
2 changed files with 12 additions and 2 deletions
|
@ -25,7 +25,7 @@ enum
|
|||
/**
|
||||
Error message on missing argument
|
||||
*/
|
||||
#define BUILTIN_ERR_MISSING _( L"%ls: Expected argument\n" )
|
||||
#define BUILTIN_ERR_MISSING _( L"%ls: Expected argument for option %ls\n" )
|
||||
|
||||
/**
|
||||
Error message on invalid combination of options
|
||||
|
|
|
@ -433,9 +433,19 @@ static int builtin_complete(parser_t &parser, wchar_t **argv)
|
|||
break;
|
||||
|
||||
case 'C':
|
||||
{
|
||||
do_complete = true;
|
||||
do_complete_param = w.woptarg ? w.woptarg : reader_get_buffer();
|
||||
const wchar_t *arg = w.woptarg ? w.woptarg : reader_get_buffer();
|
||||
if (arg == NULL)
|
||||
{
|
||||
// This corresponds to using 'complete -C' in non-interactive mode
|
||||
// See #2361
|
||||
builtin_missing_argument(parser, argv[0], argv[w.woptind-1]);
|
||||
return STATUS_BUILTIN_ERROR;
|
||||
}
|
||||
do_complete_param = arg;
|
||||
break;
|
||||
}
|
||||
|
||||
case 'h':
|
||||
builtin_print_help(parser, argv[0], stdout_buffer);
|
||||
|
|
Loading…
Reference in a new issue