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:
Alexander Udalov
2014-08-01 21:30:35 -05:00
parent cf431ffab0
commit 97e57e3e3d
15 changed files with 17 additions and 73 deletions
@@ -36,8 +36,6 @@ import org.jetbrains.jet.plugin.JetBundle;
import javax.swing.*;
import static org.jetbrains.jet.cli.common.arguments.CommonArgumentConstants.SUPPRESS_WARNINGS;
public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Configurable.NoScroll{
private final CommonCompilerArguments commonCompilerArguments;
private final K2JSCompilerArguments k2jsCompilerArguments;
@@ -88,7 +86,7 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
@Override
public boolean isModified() {
return ComparingUtils.isModified(generateNoWarningsCheckBox, isGenerateNoWarnings()) ||
return ComparingUtils.isModified(generateNoWarningsCheckBox, commonCompilerArguments.suppressWarnings) ||
ComparingUtils.isModified(additionalArgsOptionsField, compilerSettings.getAdditionalArguments()) ||
ComparingUtils.isModified(generateSourceMapsCheckBox, k2jsCompilerArguments.sourceMap) ||
isModified(outputPrefixFile, k2jsCompilerArguments.outputPrefix) ||
@@ -97,7 +95,7 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
@Override
public void apply() throws ConfigurationException {
setGenerateNoWarnings(generateNoWarningsCheckBox.isSelected());
commonCompilerArguments.suppressWarnings = generateNoWarningsCheckBox.isSelected();
compilerSettings.setAdditionalArguments(additionalArgsOptionsField.getText());
k2jsCompilerArguments.sourceMap = generateSourceMapsCheckBox.isSelected();
k2jsCompilerArguments.outputPrefix = StringUtil.nullize(outputPrefixFile.getText(), true);
@@ -106,7 +104,7 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
@Override
public void reset() {
generateNoWarningsCheckBox.setSelected(isGenerateNoWarnings());
generateNoWarningsCheckBox.setSelected(commonCompilerArguments.suppressWarnings);
additionalArgsOptionsField.setText(compilerSettings.getAdditionalArguments());
generateSourceMapsCheckBox.setSelected(k2jsCompilerArguments.sourceMap);
outputPrefixFile.setText(k2jsCompilerArguments.outputPrefix);
@@ -129,14 +127,6 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
return null;
}
private boolean isGenerateNoWarnings() {
return commonCompilerArguments.suppressAllWarnings();
}
private void setGenerateNoWarnings(boolean selected) {
commonCompilerArguments.suppress = selected ? SUPPRESS_WARNINGS : null;
}
private static void setupFileChooser(
@NotNull JLabel label,
@NotNull TextFieldWithBrowseButton fileChooser,