diff --git a/compiler/cli/src/org/jetbrains/jet/cli/common/CompilerArguments.java b/compiler/cli/src/org/jetbrains/jet/cli/common/CompilerArguments.java index e800eb04440..ea12b40e35c 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/common/CompilerArguments.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/common/CompilerArguments.java @@ -17,6 +17,7 @@ package org.jetbrains.jet.cli.common; import com.google.common.collect.Lists; +import com.sampullara.cli.Argument; import org.jetbrains.annotations.NotNull; import java.util.List; @@ -28,7 +29,6 @@ public abstract class CompilerArguments { @NotNull private List compilerPlugins = Lists.newArrayList(); - @NotNull public List getCompilerPlugins() { return compilerPlugins; @@ -40,4 +40,8 @@ public abstract class CompilerArguments { public void setCompilerPlugins(@NotNull List compilerPlugins) { this.compilerPlugins = compilerPlugins; } + + public abstract boolean isHelp(); + public abstract boolean isTags(); + public abstract boolean isVersion(); } diff --git a/compiler/cli/src/org/jetbrains/jet/cli/js/K2JSCompilerArguments.java b/compiler/cli/src/org/jetbrains/jet/cli/js/K2JSCompilerArguments.java index 46522696f05..36314959e0e 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/js/K2JSCompilerArguments.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/js/K2JSCompilerArguments.java @@ -16,9 +16,43 @@ package org.jetbrains.jet.cli.js; +import com.sampullara.cli.Argument; +import org.jetbrains.jet.cli.common.CompilerArguments; + /** * @author Pavel Talanov */ -//TODO -public class K2JSCompilerArguments { +public class K2JSCompilerArguments extends CompilerArguments { + @Argument(value = "output", description = "output directory") + public String outputDir; + + @Argument(value = "module", description = "module to compile") + public String module; + + @Argument(value = "tags", description = "Demarcate each compilation message (error, warning, etc) with an open and close tag") + public boolean tags; + + @Argument(value = "verbose", description = "Enable verbose logging output") + public boolean verbose; + + @Argument(value = "version", description = "Display compiler version") + public boolean version; + + @Argument(value = "help", alias = "h", description = "show help") + public boolean help; + + @Override + public boolean isHelp() { + return help; + } + + @Override + public boolean isTags() { + return tags; + } + + @Override + public boolean isVersion() { + return version; + } } diff --git a/compiler/cli/src/org/jetbrains/jet/cli/jvm/K2JVMCompilerArguments.java b/compiler/cli/src/org/jetbrains/jet/cli/jvm/K2JVMCompilerArguments.java index 72a94500f45..761c2d8bd3e 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/jvm/K2JVMCompilerArguments.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/jvm/K2JVMCompilerArguments.java @@ -39,18 +39,12 @@ public class K2JVMCompilerArguments extends CompilerArguments { this.sourceDirs = sourceDirs; } - @Argument(value = "output", description = "output directory") - public String outputDir; - @Argument(value = "jar", description = "jar file name") public String jar; @Argument(value = "src", description = "source file or directory") public String src; - @Argument(value = "module", description = "module to compile") - public String module; - @Argument(value = "classpath", description = "classpath to use when compiling") public String classpath; @@ -63,12 +57,15 @@ public class K2JVMCompilerArguments extends CompilerArguments { @Argument(value = "jdkHeaders", description = "Path to the kotlin-jdk-headers.jar") public String jdkHeaders; - @Argument(value = "help", alias = "h", description = "show help") - public boolean help; - @Argument(value = "mode", description = "Special compiler modes: stubs or jdkHeaders") public String mode; + @Argument(value = "output", description = "output directory") + public String outputDir; + + @Argument(value = "module", description = "module to compile") + public String module; + @Argument(value = "tags", description = "Demarcate each compilation message (error, warning, etc) with an open and close tag") public boolean tags; @@ -78,6 +75,8 @@ public class K2JVMCompilerArguments extends CompilerArguments { @Argument(value = "version", description = "Display compiler version") public boolean version; + @Argument(value = "help", alias = "h", description = "show help") + public boolean help; public String getClasspath() { return classpath; @@ -87,6 +86,7 @@ public class K2JVMCompilerArguments extends CompilerArguments { this.classpath = classpath; } + @Override public boolean isHelp() { return help; } @@ -143,10 +143,16 @@ public class K2JVMCompilerArguments extends CompilerArguments { this.stdlib = stdlib; } + @Override public boolean isTags() { return tags; } + @Override + public boolean isVersion() { + return version; + } + public void setTags(boolean tags) { this.tags = tags; }