ScalaCommand

scala.cli.commands.ScalaCommand
abstract class ScalaCommand[T <: HasGlobalOptions](implicit myParser: Parser[T], help: Help[T]) extends Command[T], NeedsArgvCommand, CommandHelpers, RestrictableCommand[T]

Attributes

Graph
Supertypes
class Command[T]
class CaseApp[T]
class Object
trait Matchable
class Any
Show all
Known subtypes
object AddPath.type
object Bloop.type
object BloopExit.type
object BloopOutput.type
object BloopStart.type
object Bsp.type
object Clean.type
object Compile.type
object Config.type
object DefaultFile.type
object DependencyUpdate.type
object Directories.type
object Doc.type
object Export.type
object Fix.type
object Fmt.type
object SecretCreate.type
object SecretList.type
object InstallCompletions.type
object InstallHome.type
object New.type
object Package.type
object PgpPull.type
object PgpPush.type
object Publish.type
object PublishLocal.type
object PublishSetup.type
object Repl.type
object Run.type
object SetupIde.type
object Shebang.type
object Test.type
object Uninstall.type
object UninstallCompletions.type
object Update.type
object Version.type
class Default
class HelpCmd
Show all

Members list

Type members

Inherited classlikes

implicit class EitherBuildExceptionOps[E <: BuildException, T](either: Either[E, T])

Attributes

Inherited from:
CommandHelpers
Supertypes
class Object
trait Matchable
class Any

Value members

Abstract methods

def runCommand(options: T, remainingArgs: RemainingArgs, logger: Logger): Unit

This should be overridden instead of run when extending ScalaCommand.

This should be overridden instead of run when extending ScalaCommand.

Value parameters

options

the command's specific set of options

remainingArgs

arguments remaining after parsing options

Attributes

Concrete methods

protected def actualCommandName: String

The actual sub-command name that was used. If the sub-command name is a list of strings, space is used as the separator. If argvOpt hasn't been defined, it defaults to name.

The actual sub-command name that was used. If the sub-command name is a list of strings, space is used as the separator. If argvOpt hasn't been defined, it defaults to name.

Attributes

protected def actualFullCommand: String
protected def allowRestrictedFeatures: Boolean
protected def baseRunnerName: String

Attributes

Returns

the actual Scala CLI base runner name, for SIP it is scala otherwise scala-cli

def buildOptions(options: T): Option[BuildOptions]

Value parameters

options

command-specific T options

Attributes

Returns

Tries to create BuildOptions based on sharedOptions and exits on error. Override to change this behaviour.

protected def buildOptionsOrExit(options: T): BuildOptions
override def completer: Completer[T]

Attributes

Definition Classes
CaseApp
override def error(message: Error): Nothing

Attributes

Definition Classes
CaseApp
protected def fullRunnerName: String

Attributes

Returns

the actual Scala CLI runner name which was run

override def hasFullHelp: Boolean

Attributes

Definition Classes
CaseApp
override def helpFormat: HelpFormat

Attributes

Definition Classes
CaseApp
override def hidden: Boolean

Attributes

Definition Classes
Command
protected def invokeData: ScalaCliInvokeData
override def logger: Logger

Attributes

Definition Classes
final override def main(progName: String, args: Array[String]): Unit

Attributes

Definition Classes
CaseApp
def maybePrintGroupHelp(options: T): Unit
def maybePrintSimpleScalacOutput(options: T, buildOptions: BuildOptions): Unit

Print scalac output if passed options imply no inputs are necessary and raw scalac output is required instead. (i.e. --scalac-option -help)

Print scalac output if passed options imply no inputs are necessary and raw scalac output is required instead. (i.e. --scalac-option -help)

Value parameters

options

command options

Attributes

def maybePrintToolsHelp(options: T, buildOptions: BuildOptions): Unit
protected def progName: String

Attributes

Returns

the actual Scala CLI program name which was run

final override def run(options: T, remainingArgs: RemainingArgs): Unit

This implementation is final. Override runCommand instead. This logic is invoked at the start of running every ScalaCommand.

This implementation is final. Override runCommand instead. This logic is invoked at the start of running every ScalaCommand.

Attributes

Definition Classes
CaseApp
override def setArgv(argv: Array[String]): Unit

Attributes

Definition Classes
def sharedOptions(t: T): Option[SharedOptions]

Attributes

Definition Classes

Inherited methods

protected def SpecificationLevel: SpecificationLevel.type

Attributes

Inherited from:
RestrictableCommand
def complete(args: Seq[String], index: Int): List[CompletionItem]

Attributes

Inherited from:
CaseApp
def ensureNoDuplicates(): Unit

Attributes

Inherited from:
CaseApp
def exit(code: Int): Nothing

Attributes

Inherited from:
CaseApp
def expandArgs(args: List[String]): List[String]

Arguments are expanded then parsed. By default, argument expansion is the identity function. Overriding this method allows plugging in an arbitrary argument expansion logic.

Arguments are expanded then parsed. By default, argument expansion is the identity function. Overriding this method allows plugging in an arbitrary argument expansion logic.

One such expansion logic involves replacing each argument of the form '@ ' with the contents of that file where each line in the file becomes a distinct argument. To enable this behavior, override this method as shown below.

Attributes

Example
import caseapp.core.parser.PlatformArgsExpander
override def expandArgs(args: List[String]): List[String]
= PlatformArgsExpander.expand(args)
Inherited from:
CaseApp
def fullHelpAsked(progName: String): Nothing

Attributes

Inherited from:
CaseApp
def group: String

Attributes

Inherited from:
Command
def hasHelp: Boolean

Attributes

Inherited from:
CaseApp
def helpAsked(progName: String, maybeOptions: Either[Error, T]): Nothing

Attributes

Inherited from:
CaseApp
def ignoreUnrecognized: Boolean

Whether to ignore unrecognized arguments.

Whether to ignore unrecognized arguments.

That is, if there are unrecognized arguments, the parsing still succeeds. The unparsed arguments are put in the args argument of run.

Attributes

Inherited from:
CaseApp
final def isExperimental: Boolean

Attributes

Inherited from:
RestrictableCommand
final def isRestricted: Boolean

Attributes

Inherited from:
RestrictableCommand
def main(args: Array[String]): Unit

Attributes

Inherited from:
CaseApp
def name: String

Attributes

Inherited from:
Command
def names: List[List[String]]

Attributes

Inherited from:
Command
override def parser: Parser[T]

Attributes

Definition Classes
Inherited from:
RestrictableCommand
final def printLine(line: String): Unit

Attributes

Inherited from:
CaseApp
def printLine(line: String, toStderr: Boolean): Unit

Attributes

Inherited from:
CaseApp
def scalaSpecificationLevel: SpecificationLevel

Is that command a MUST / SHOULD / NICE TO have for the Scala runner specification?

Is that command a MUST / SHOULD / NICE TO have for the Scala runner specification?

Attributes

Inherited from:
RestrictableCommand

Whether to stop parsing at the first unrecognized argument.

Whether to stop parsing at the first unrecognized argument.

That is, stop parsing at the first non option (not starting with "-"), or the first unrecognized option. The unparsed arguments are put in the args argument of run.

Attributes

Inherited from:
CaseApp
def usageAsked(progName: String, maybeOptions: Either[Error, T]): Nothing

Attributes

Inherited from:
CaseApp

Concrete fields

protected var argvOpt: Option[Array[String]]
override val messages: Help[T]
lazy override val nameFormatter: Formatter[Name]

Inherited fields

lazy val finalHelp: Help[_]

Attributes

Inherited from:
CaseApp

Givens

Givens

given given_ScalaCliInvokeData: ScalaCliInvokeData

Implicits

Inherited implicits

final implicit def EitherBuildExceptionOps[E <: BuildException, T](either: Either[E, T]): EitherBuildExceptionOps[E, T]

Attributes

Inherited from:
CommandHelpers
implicit val parser0: Parser[T]

Attributes

Inherited from:
CaseApp