How do I pass `--` flags as arguments to a script?...
# scripting
j
How do I pass
--
flags as arguments to a script? They are interpreted by kotlin rather than passed as arguments to my script. I tried using
env -S kotlin --
as my shebang but
kotlin
doesn't seem to support
--
👀 1
e.g.,
Copy code
$ ./test.main.kts --debug
error: invalid argument: --debug
info: use -help for more information
k
Try using this library... Been pretty happy with it used with kscript: https://ajalt.github.io/clikt/
j
Yes i use clikt everywhere, but the problem was about kotlin intercepting arguments before they even made it into the
args
array
👍 2