File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
modules/cli/src/main/scala/scala/cli/commands/default Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,20 @@ class Default(
18
18
isSipScala : Boolean
19
19
) extends ScalaCommand [DefaultOptions ] {
20
20
21
- private def defaultHelp : String = actualHelp.help(ScalaCliHelp .helpFormat)
22
- private def defaultFullHelp : String = actualHelp.help(ScalaCliHelp .helpFormat, showHidden = true )
21
+ private lazy val defaultCommandHelp : String =
22
+ s """
23
+ |
24
+ |When no subcommand is passed explicitly, an implicit subcommand is used based on context:
25
+ | - if the '--version' option is passed, it prints the 'version' subcommand output, unmodified by any other options
26
+ | - if any inputs were passed, it defaults to the 'run' subcommand
27
+ | - additionally, when no inputs were passed, it defaults to the 'run' subcommand in the following scenarios:
28
+ | - if a snippet was passed with any of the '--execute*' options
29
+ | - if a main class was passed with the '--main-class' option alongside an extra '--classpath'
30
+ | - otherwise, if no inputs were passed, it defaults to the 'repl' subcommand """ .stripMargin
31
+
32
+ private def defaultHelp : String = actualHelp.help(ScalaCliHelp .helpFormat) + defaultCommandHelp
33
+ private def defaultFullHelp : String =
34
+ actualHelp.help(ScalaCliHelp .helpFormat, showHidden = true ) + defaultCommandHelp
23
35
24
36
override def group = " Main"
25
37
override def sharedOptions (options : DefaultOptions ): Option [SharedOptions ] = Some (options.shared)
You can’t perform that action at this time.
0 commit comments