Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"args-example" was not provided as a first argument #82

Open
Anton-4 opened this issue Jul 5, 2023 · 0 comments
Open

"args-example" was not provided as a first argument #82

Anton-4 opened this issue Jul 5, 2023 · 0 comments

Comments

@Anton-4
Copy link
Collaborator

Anton-4 commented Jul 5, 2023

$ ./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."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant