basic-cli
basic-cli copied to clipboard
received command line args are empty when using --linker=legacy
$ ./target/release/roc run examples/args.roc --linker=legacy -- log -b 3 --num 81
args-example
A calculator example of the CLI platform argument parser
COMMANDS:
div
OPTIONS:
--dividend, -n the number to divide; corresponds to a numerator (integer, 64-bit signed)
--divisor, -d the number to divide by; corresponds to a denominator (integer, 64-bit signed)
log
OPTIONS:
--base, -b base of the logarithm (integer, 64-bit signed)
--num the number to take the logarithm of (integer, 64-bit signed)
The program name "args-example" was not provided as a first argument!
The weird thing is, this only happens when using a basic-cli release, not when building the platform from source.
We use the rust args_os
function under the hood, in the docs it is mentioned that "The first element is traditionally the path of the executable, but it can be set to arbitrary text, and might not even exist. This means this property should not be relied upon for security purposes."