mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
parent
b49e1d7703
commit
0da8022081
3 changed files with 8 additions and 0 deletions
|
@ -186,5 +186,9 @@ int builtin_math(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
|||
expression.append(arg);
|
||||
}
|
||||
|
||||
if (expression.empty()) {
|
||||
streams.err.append_format(BUILTIN_ERR_MIN_ARG_COUNT1, L"math", 1, 0);
|
||||
return STATUS_CMD_ERROR;
|
||||
}
|
||||
return evaluate_expression(cmd, parser, streams, opts, expression);
|
||||
}
|
||||
|
|
|
@ -22,3 +22,5 @@ math: Error: Too few arguments
|
|||
math: Error: Too many arguments
|
||||
'2 + 2 4'
|
||||
^
|
||||
math: Expected at least 1 args, got only 0
|
||||
math: Expected at least 1 args, got only 0
|
||||
|
|
|
@ -29,3 +29,5 @@ not math 'ncr(1)'
|
|||
not math 'max()'
|
||||
not math 'sin()'
|
||||
not math '2 + 2 4'
|
||||
not math
|
||||
not math -s 12
|
||||
|
|
Loading…
Reference in a new issue