Commit d153427 1 parent 66dd929 commit d153427 Copy full SHA for d153427
File tree 2 files changed +13
-2
lines changed
cli/src/main/scala/scala/cli
integration/src/test/scala/scala/cli/integration
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ class ScalaCliCommands(
112
112
case c : NeedsArgvCommand => c.setArgv(progName +: args)
113
113
case _ =>
114
114
}
115
+ actualDefaultCommand.setArgv(progName +: args)
115
116
116
117
val processedArgs =
117
118
if (args.lengthCompare(1 ) > 0 && isShebangFile(args(0 )))
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class DefaultTests extends ScalaCliSuite {
18
18
check = false
19
19
)
20
20
expect(res.exitCode == 1 )
21
- expect(res.out.trim == s " Unrecognized argument: $ runSpecificOption" )
21
+ expect(res.out.trim == unrecognizedArgMessage( runSpecificOption) )
22
22
}
23
23
}
24
24
test(" running scala-cli with args should not accept repl-only options" ) {
@@ -30,7 +30,17 @@ class DefaultTests extends ScalaCliSuite {
30
30
check = false
31
31
)
32
32
expect(res.exitCode == 1 )
33
- expect(res.out.trim == s " Unrecognized argument: $ replSpecificOption" )
33
+ expect(res.out.trim == unrecognizedArgMessage( replSpecificOption) )
34
34
}
35
35
}
36
+
37
+ private def unrecognizedArgMessage (argName : String ) = {
38
+ val scalaCli = if (TestUtil .isNativeCli) TestUtil .cliPath else " scala-cli"
39
+ s """
40
+ |Unrecognized argument: $argName
41
+ |
42
+ |To list all available options, run
43
+ | ${Console .BOLD }$scalaCli --help ${Console .RESET }
44
+ | """ .stripMargin.trim
45
+ }
36
46
}
You can’t perform that action at this time.
0 commit comments