diff options
author | Paul Phillips <paulp@improving.org> | 2011-03-30 00:55:20 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-03-30 00:55:20 +0000 |
commit | 5691a3900dd81cfaaa25e618828d854bed277039 (patch) | |
tree | 014c34fd8d33ecd3a368841c3c5380e76aa5987b /src/compiler/scala/tools/nsc/settings/AbsSettings.scala | |
parent | f21113d28ae0fa4bae1f405933991c323f5f5553 (diff) | |
download | scala-5691a3900dd81cfaaa25e618828d854bed277039.tar.gz scala-5691a3900dd81cfaaa25e618828d854bed277039.tar.bz2 scala-5691a3900dd81cfaaa25e618828d854bed277039.zip |
Wanting to deprecate -make, first I had to writ...
Wanting to deprecate -make, first I had to write a way to deprecate
-make. So there's that, now you can do
val s = SomeSetting(...) withDeprecationMessage "don't use this"
And it will do the usual deprecation things. And, deprecated -make. And
couldn't resist fixing a bug in -make, it would crash if you gave it its
own default option (i.e. -make:all.) Let's deprecate more!
I also did further cleaning up of our help outputs. Do I smell a
pulitzer in the making? No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/settings/AbsSettings.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/settings/AbsSettings.scala | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/settings/AbsSettings.scala b/src/compiler/scala/tools/nsc/settings/AbsSettings.scala index f70e6dc7d3..82e311028b 100644 --- a/src/compiler/scala/tools/nsc/settings/AbsSettings.scala +++ b/src/compiler/scala/tools/nsc/settings/AbsSettings.scala @@ -75,8 +75,10 @@ trait AbsSettings { */ def withAbbreviation(name: String): this.type def withHelpSyntax(help: String): this.type + def withDeprecationMessage(msg: String): this.type def helpSyntax: String = name + def deprecationMessage: Option[String] = None def abbreviations: List[String] = Nil def dependencies: List[(Setting, String)] = Nil def respondsTo(label: String) = (name == label) || (abbreviations contains label) @@ -122,10 +124,11 @@ trait AbsSettings { /** These categorizations are so the help output shows -X and -P among * the standard options and -Y among the advanced options. */ - def isAdvanced = name match { case "-Y" => true ; case "-X" => false ; case _ => name startsWith "-X" } - def isPrivate = name match { case "-Y" => false ; case _ => name startsWith "-Y" } - def isStandard = !isAdvanced && !isPrivate - def isForDebug = isPrivate && (name contains ("-debug")) // by convention, i.e. -Ytyper-debug + def isAdvanced = name match { case "-Y" => true ; case "-X" => false ; case _ => name startsWith "-X" } + def isPrivate = name match { case "-Y" => false ; case _ => name startsWith "-Y" } + def isStandard = !isAdvanced && !isPrivate + def isForDebug = name endsWith "-debug" // by convention, i.e. -Ytyper-debug + def isDeprecated = deprecationMessage.isDefined def compare(that: Setting): Int = name compare that.name |