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

cpp.cppia.Host does not follow haxe's Sys.args() and Sys.programPath() documentation #1174

Open
tobil4sk opened this issue Jan 16, 2025 · 0 comments

Comments

@tobil4sk
Copy link
Member

According to the Haxe docs:

Sys.args()
Returns all the arguments that were passed in the command line. This does not include the interpreter or the name of the program file.

Sys.programPath()
Returns the absolute path to the current program file that we are running. Concretely, for an executable binary, it returns the path to the binary. For a script (e.g. a PHP file), it returns the path to the script.

This suggests that the following output should be expected when running this script with Cppia script.cppia:

function main() {
    trace(Sys.programPath()); // script.cppia
    trace(Sys.args()); // []
}

Instead we get:

// Cppia
// ["script.cppia"]

Perhaps the cpp.cppia.Host.runFile() should take an args argument, then runFile should store the script file name and arguments somewhere. Sys.args() and Sys.programPath() should be virtual calls that return these values.

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