effekt
effekt copied to clipboard
Command line args can not be passed into effekt execution
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
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