Closed zmrocze closed 12 months ago
Hello @zmrocze,
Thanks for your bug report.
It turns out that the issue is with your command line shell and what it supplies to the calc command. And quoting as in '-0'
doesn't help.
When your shell parses the command:
$ calc '-0'
your shell supplies to the calc command, the 2 argv arguments:
argv[0]: calc
argv[1]: -0
The calc command line parser then evaluates the command line, determines there is NO -0
option and throws an error.
The calc(1)
man page states:
-- The double dash indicates to calc that no more option follow. Thus calc will ignore a later argument on the command
line even if it starts with a dash. This is useful when entering negative values on the command line as in:
calc -p -- -1 - -7
So had you done the following:
$ calc -- '-0'
or even:
$ calc -- -0
it would have worked.
See the "CALC COMMAND LINE" section of the calc(1)
man page for more details.
We hope this helps!
Hey guys!
Letting you know you don't parse correctly expressions starting with
-
, i.e.fails but
succeeds.
I don't blame you, made the same mistake in one of my older projects.