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:
Fabian Homborg 2020-04-04 20:34:42 +02:00
parent 6a721fab63
commit 4eccc0f6d1

View File

@ -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;
}