All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dotty.tools.dotc.config.CompilerCommand.scala Maven / Gradle / Ivy

There is a newer version: 3.6.4-RC1-bin-20241220-0bfa1af-NIGHTLY
Show newest version
package dotty.tools.dotc
package config

import Settings.*
import core.Contexts.*

abstract class CompilerCommand extends CliCommand:
  type ConcreteSettings = ScalaSettings

  final def helpMsg(using settings: ConcreteSettings)(using SettingsState, Context): String =
    settings.allSettings.find(isHelping) match
      case Some(s @ settings.language) => availableOptionsMsg(_ == s, showArgFileMsg = false)
      case Some(s) => s.description
      case _ =>
        if (settings.help.value) usageMessage
        else if (settings.Vhelp.value) vusageMessage
        else if (settings.Whelp.value) wusageMessage
        else if (settings.Xhelp.value) xusageMessage
        else if (settings.Yhelp.value) yusageMessage
        else if (settings.showPlugins.value) ctx.base.pluginDescriptions
        else if (settings.XshowPhases.value) phasesMessage
        else ""

  final def isHelpFlag(using settings: ConcreteSettings)(using SettingsState): Boolean =
    import settings.*
    val flags = Set(help, Vhelp,  Whelp, Xhelp, Yhelp, showPlugins, XshowPhases)
    flags.exists(_.value) || allSettings.exists(isHelping)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy