Skip to content

Commit 084ec4a

Browse files
committed
Add deprecation message to -{Y, X, W, ...} compiler flag
1 parent ee74631 commit 084ec4a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/config/CliCommand.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ trait CliCommand:
6060
def defaultValue = s.default match
6161
case _: Int | _: String => s.default.toString
6262
case _ => ""
63-
val info = List(shortHelp(s), if defaultValue.nonEmpty then s"Default $defaultValue" else "", if s.legalChoices.nonEmpty then s"Choices : ${s.legalChoices}" else "")
63+
val deprecationMessage = s.deprecation.map(d => s"Option deprecated.\n${d.msg}").getOrElse("")
64+
val info = List(deprecationMessage, shortHelp(s), if defaultValue.nonEmpty then s"Default $defaultValue" else "", if s.legalChoices.nonEmpty then s"Choices : ${s.legalChoices}" else "")
6465
(s.name, info.filter(_.nonEmpty).mkString("\n"))
6566
end help
6667

0 commit comments

Comments
 (0)