scala-cli running jar files
As requested by @lrytz in https://contributors.scala-lang.org/t/pre-sip-scala-cli-as-new-scala-command/5628/4 scala-cli should be able to run jar files!
So in a discussion with @lwronski we came up with the following initial syntax
scala-cli —jar jarFileName.jar < the options and arguments to be passed to scala-cli> -- <the options and arguments to be passed to java>
This way, the implementation for the handling of the arguments would be like that of repl. Also java itself can handle both the arguments to be passed to the jar and its own options such as the selection of main class.
One alternative was to put the java and scala-cli options together before the -- and to put all the arguments to be passed to the jar file after the -- . But, this is difficult to maintain because it would be difficult to keep up with deciding which option should be passed to java and which one to scala-cli.
It seems like running jar files is not a requested feature! https://contributors.scala-lang.org/t/pre-sip-scala-cli-as-new-scala-command/5628/6 @romanowski
I think it indeed is useful to be able to run a jar!
You can already run jar files with run, you just kinda still need to pass a .scala file or the tool will complain, that is:
❯ echo "" | scala-cli run --jar Main.jar -M Main _.scala -- a b c
args are: a b c
So to me it seems the most reasonable would be to just allow omitting .scala file if a jar is provided.
This will be delivered in #1641, closing this ticket