CLI: change "-suppress warnings" option to "-nowarn"
Following the rule of the least surprise: this option is named "-nowarn" in other JVM language compilers. Besides, having an option with an argument which can take exactly one predefined value is sort of confusing
This commit is contained in:
-21
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.cli.common.arguments;
|
||||
|
||||
public interface CommonArgumentConstants {
|
||||
String SUPPRESS_WARNINGS = "warnings";
|
||||
}
|
||||
+3
-10
@@ -22,9 +22,10 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.jet.cli.common.arguments.CommonArgumentConstants.SUPPRESS_WARNINGS;
|
||||
|
||||
public abstract class CommonCompilerArguments {
|
||||
@Argument(value = "nowarn", description = "Generate no warnings")
|
||||
public boolean suppressWarnings;
|
||||
|
||||
@Argument(value = "tags", description = "Demarcate each compilation message (error, warning, etc) with an open and close tag")
|
||||
public boolean tags;
|
||||
|
||||
@@ -37,19 +38,11 @@ public abstract class CommonCompilerArguments {
|
||||
@Argument(value = "help", alias = "h", description = "Print a synopsis of standard options")
|
||||
public boolean help;
|
||||
|
||||
@Argument(value = "suppress", description = "Suppress all compiler warnings")
|
||||
@ValueDescription(SUPPRESS_WARNINGS)
|
||||
public String suppress;
|
||||
|
||||
@Argument(value = "X", description = "Print a synopsis of advanced options")
|
||||
public boolean extraHelp;
|
||||
|
||||
public List<String> freeArgs = new SmartList<String>();
|
||||
|
||||
public boolean suppressAllWarnings() {
|
||||
return SUPPRESS_WARNINGS.equalsIgnoreCase(suppress);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String executableScriptFileName() {
|
||||
return "kotlinc";
|
||||
|
||||
Reference in New Issue
Block a user