ScalaCommand

abstract class ScalaCommand[T <: HasLoggingOptions](implicit myParser: Parser[T], help: Help[T]) extends Command[T] with NeedsArgvCommand with CommandHelpers with RestrictableCommand[T]
class Command[T]
class CaseApp[T]
class Object
trait Matchable
class Any
class HelpCmd
object About.type
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
class Default
object DefaultFile.type
object DependencyUpdate.type
object Directories.type
object Doc.type
object Doctor.type
object Export.type
object Fmt.type
object SecretCreate.type
object SecretList.type
object InstallCompletions.type
object InstallHome.type
object Metabrowse.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 Update.type
object Version.type

Type members

Inherited classlikes

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

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

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.

protected def actualFullCommand: String
protected def baseRunnerName: String
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

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]
Definition Classes
CaseApp
override def error(message: Error): Nothing
Definition Classes
CaseApp
protected def fullRunnerName: String
Returns:

the actual Scala CLI runner name which was run

override def hasFullHelp: Boolean
Definition Classes
CaseApp
override def helpFormat: HelpFormat
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

def maybePrintToolsHelp(options: T, buildOptions: BuildOptions): Unit
protected def progName: String
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.

Definition Classes
CaseApp
override def setArgv(argv: Array[String]): Unit
Definition Classes
def sharedOptions(t: T): Option[SharedOptions]

Inherited methods

def complete(args: Seq[String], index: Int): List[CompletionItem]
Inherited from:
CaseApp
def ensureNoDuplicates(): Unit
Inherited from:
CaseApp
def exit(code: Int): Nothing
Inherited from:
CaseApp
def expandArgs(args: List[String]): List[String]
Inherited from:
CaseApp
def fullHelpAsked(progName: String): Nothing
Inherited from:
CaseApp
def group: String
Inherited from:
Command
def hasHelp: Boolean
Inherited from:
CaseApp
def helpAsked(progName: String, maybeOptions: Either[Error, T]): Nothing
Inherited from:
CaseApp
def hidden: Boolean
Inherited from:
Command
def ignoreUnrecognized: Boolean
Inherited from:
CaseApp
def isRestricted: Boolean
Inherited from:
RestrictableCommand
def main(progName: String, args: Array[String]): Unit
Inherited from:
CaseApp
def main(args: Array[String]): Unit
Inherited from:
CaseApp
def name: String
Inherited from:
Command
def names: List[List[String]]
Inherited from:
Command
override def parser: Parser[T]
Definition Classes
Inherited from:
RestrictableCommand
Inherited from:
CaseApp
def usageAsked(progName: String, maybeOptions: Either[Error, T]): Nothing
Inherited from:
CaseApp

Concrete fields

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

Implicits

Inherited implicits

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