effekt icon indicating copy to clipboard operation
effekt copied to clipboard

Command line args can not be passed into effekt execution

Open IR0NSIGHT opened this issue 1 year ago • 1 comments

expected behaviour:

WHEN i run

effekt.sh myFile.effekt hello world

THEN myFile.effekt main() gets executed AND commandLineArgs() returns ["hello","world"]

observed behaviour:

WHEN i run

effekt.sh myFile.effekt hello world

THEN myFile.effekt main() gets executed AND throws:

hello (Datei oder Verzeichnis nicht gefunden)
world (Datei oder Verzeichnis nicht gefunden)

AND commandLineargs() evaluates to Nil()

Notes

i could not find a way to pass cmdargs directly into an execution. currently i have to compile to js and call that file with the cmd args using Node.js

IR0NSIGHT avatar Nov 06 '23 17:11 IR0NSIGHT

Note that this is expected behavior and not a bug. You are asking for a new feature, which is to pass additional arguments to the command line when running a program. Right now,

effekt.sh myFile.effekt hello world

will compile three effekt files effekt.sh myFile.effekt, hello, and world.

We could deprecate this functionality in favour of your proposed behaviour. However, typically one would have a separate command line argument or separate additional arguments with -- like

effekt.sh myFile.effekt -- hello world

b-studios avatar Nov 07 '23 09:11 b-studios