Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

Commit d7be78d

Browse files
committed
List Typelevel options when -Z flag is given
1 parent aceb216 commit d7be78d

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/compiler/scala/tools/nsc/CompilerCommand.scala

+2
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class CompilerCommand(arguments: List[String], val settings: Settings) {
8282
def usageMsg = createUsageMsg("where possible standard", shouldExplain = false, _.isStandard)
8383
def xusageMsg = createUsageMsg("Possible advanced", shouldExplain = true, _.isAdvanced)
8484
def yusageMsg = createUsageMsg("Possible private", shouldExplain = true, _.isPrivate)
85+
def zusageMsg = createUsageMsg("Possible Typelevel", shouldExplain = true, _.isTypelevel)
8586

8687
/** For info settings, compiler should just print a message and quit. */
8788
def shouldStopWithInfo = settings.isInfo
@@ -95,6 +96,7 @@ class CompilerCommand(arguments: List[String], val settings: Settings) {
9596
else if (help) usageMsg + global.pluginOptionsHelp
9697
else if (Xhelp) xusageMsg
9798
else if (Yhelp) yusageMsg
99+
else if (Zhelp) zusageMsg
98100
else if (showPlugins) global.pluginDescriptions
99101
else if (showPhases) global.phaseDescriptions + (
100102
if (debug) "\n" + global.phaseFlagDescriptions else ""

src/compiler/scala/tools/nsc/settings/AbsSettings.scala

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ trait AbsSettings extends scala.reflect.internal.settings.AbsSettings {
109109
*/
110110
def isAdvanced = name match { case "-Y" => true ; case "-X" => false ; case _ => name startsWith "-X" }
111111
def isPrivate = name match { case "-Y" => false ; case _ => name startsWith "-Y" }
112+
def isTypelevel = name match { case "-Z" => false ; case _ => name startsWith "-Z" }
112113
def isStandard = !isAdvanced && !isPrivate
113114
def isForDebug = name endsWith "-debug" // by convention, i.e. -Ytyper-debug
114115
def isDeprecated = deprecationMessage.isDefined

src/compiler/scala/tools/nsc/settings/ScalaSettings.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ trait ScalaSettings extends AbsScalaSettings
4242
def optimiseSettings = List[BooleanSetting](inline, inlineHandlers, Xcloselim, Xdce, YconstOptimization)
4343

4444
/** If any of these settings is enabled, the compiler should print a message and exit. */
45-
def infoSettings = List[Setting](version, help, Xhelp, Yhelp, showPlugins, showPhases, genPhaseGraph)
45+
def infoSettings = List[Setting](version, help, Xhelp, Yhelp, Zhelp, showPlugins, showPhases, genPhaseGraph)
4646

4747
/** Any -multichoice:help? Nicer if any option could report that it had help to offer. */
4848
private def multihelp = allSettings exists { case s: MultiChoiceSetting => s.isHelping case _ => false }
@@ -220,6 +220,7 @@ trait ScalaSettings extends AbsScalaSettings
220220
/**
221221
* -Z Typelevel settings
222222
*/
223+
val Zhelp = BooleanSetting("-Z", "Print a synopsis of Typelevel options.")
223224
val ZirrefutableGeneratorPatterns = BooleanSetting("-Zirrefutable-generator-patterns", "Treat patterns in for comprehensions as irrefutable. Do not add filter or withFilter calls.")
224225

225226
/** Area-specific debug output.

0 commit comments

Comments
 (0)