Problem running `@main` methods with command line arguments
See original GitHub issueCompiler version
3.1.1
Minimized code
// In file echoargs.scala
@main def echo(args: String*) =
println(args.mkString(" "))
Output
First compile
$ scalac echoargs.scala
Then run the main method:
$ scala echo hello world
echo hello world hello world
Expectation
$ scala echo hello world
hello world
Edit: this was the output using the scala
command of 3.0.2
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Main() and command-line arguments | Microsoft Learn
Learn about Main() and command-line arguments. The 'Main' method is the entry point of an executable program.
Read more >Getting an error running this program as a command line ...
Try Below Code: public class SumOfNumbers { public static void main(String[] args) { int[] intArgs = new int[args.length]; for (int x = 0; ......
Read more >Make sure that command line arguments are used safely here ...
How to fix issue in Spring boot main method: Make sure that command line arguments are used safely here - SonarQube - Sonar...
Read more >Command Line Arguments in Java - DigitalOcean
Command -line arguments in Java are used to pass arguments to the main program. If you look at the Java main method syntax,...
Read more >The Main method | Command line arguments in Java - YouTube
Java Tutorial - Java Command Line Argument Playlist link (You can download Java example code from each video description from this ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Crossword just had clue “hello hello hello, e.g.” for “echo”.
The book told me to do it! (Prog in Scala 5th ed) It’s used to show the power of type classes: