mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-21 02:54:17 +08:00
true/false: Stop erroring out for arguments
For `true`, this makes uses like the : some description of the job & we used to have impossible, also it's just *wrong* that true can return something that isn't true. For false it's not super important but it should generally be symmetrical with true.
This commit is contained in:
parent
6a721fab63
commit
4eccc0f6d1
|
@ -317,20 +317,14 @@ static int builtin_breakpoint(parser_t &parser, io_streams_t &streams, wchar_t *
|
|||
int builtin_true(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
||||
UNUSED(parser);
|
||||
UNUSED(streams);
|
||||
if (argv[1] != nullptr) {
|
||||
streams.err.append_format(BUILTIN_ERR_ARG_COUNT1, argv[0], 0, builtin_count_args(argv) - 1);
|
||||
return STATUS_INVALID_ARGS;
|
||||
}
|
||||
UNUSED(argv);
|
||||
return STATUS_CMD_OK;
|
||||
}
|
||||
|
||||
int builtin_false(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
||||
UNUSED(parser);
|
||||
UNUSED(streams);
|
||||
if (argv[1] != nullptr) {
|
||||
streams.err.append_format(BUILTIN_ERR_ARG_COUNT1, argv[0], 0, builtin_count_args(argv) - 1);
|
||||
return STATUS_INVALID_ARGS;
|
||||
}
|
||||
UNUSED(argv);
|
||||
return STATUS_CMD_ERROR;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user