I have a .main.kts and want to run it from the com...
# scripting
p
I have a .main.kts and want to run it from the command line. It has a shebang:
#!/usr/bin/env kotlin
. This works fine but when I want to call it with arguments I always have to put a
--
first because else the commands are passed to kotlin and not to the script. I.e.
./my_script.main.kts -- --my-flag
Is there a way to define this so I dont have to call
--
first?
You can workaround with
#!/usr/bin/env kotlinc -script --
But I'm not sure there's a better option