Beautify kotlinc -help output
This commit is contained in:
+9
-1
@@ -18,8 +18,10 @@ package org.jetbrains.jet.cli.common.arguments;
|
||||
|
||||
import com.intellij.util.SmartList;
|
||||
import com.sampullara.cli.Argument;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.jet.cli.common.arguments.CommonArgumentConstants.SUPPRESS_WARNINGS;
|
||||
|
||||
public abstract class CommonCompilerArguments {
|
||||
@@ -35,7 +37,8 @@ public abstract class CommonCompilerArguments {
|
||||
@Argument(value = "help", alias = "h", description = "Print a synopsis of standard options")
|
||||
public boolean help;
|
||||
|
||||
@Argument(value = "suppress", description = "Suppress compiler messages by severity (" + SUPPRESS_WARNINGS + ")")
|
||||
@Argument(value = "suppress", description = "Suppress all compiler warnings")
|
||||
@ValueDescription(SUPPRESS_WARNINGS)
|
||||
public String suppress;
|
||||
|
||||
@Argument(value = "printArgs", description = "Print command line arguments")
|
||||
@@ -47,6 +50,11 @@ public abstract class CommonCompilerArguments {
|
||||
return SUPPRESS_WARNINGS.equalsIgnoreCase(suppress);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String executableScriptFileName() {
|
||||
return "kotlinc";
|
||||
}
|
||||
|
||||
// Used only for serialize and deserialize settings. Don't use in other places!
|
||||
public static final class DummyImpl extends CommonCompilerArguments {}
|
||||
}
|
||||
|
||||
+17
-4
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.jet.cli.common.arguments;
|
||||
|
||||
import com.sampullara.cli.Argument;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import static org.jetbrains.jet.cli.common.arguments.K2JsArgumentConstants.CALL;
|
||||
@@ -27,28 +28,40 @@ import static org.jetbrains.jet.cli.common.arguments.K2JsArgumentConstants.NO_CA
|
||||
*/
|
||||
public class K2JSCompilerArguments extends CommonCompilerArguments {
|
||||
@Argument(value = "output", description = "Output file path")
|
||||
@ValueDescription("<path>")
|
||||
public String outputFile;
|
||||
|
||||
@Argument(value = "libraryFiles", description = "Path to zipped lib sources or kotlin files")
|
||||
@Argument(value = "libraryFiles", description = "Path to zipped library sources or kotlin files separated by commas")
|
||||
@ValueDescription("<path[,]>")
|
||||
public String[] libraryFiles;
|
||||
|
||||
@Argument(value = "sourceFiles", description = "Source files (dir or file)")
|
||||
@Argument(value = "sourceFiles", description = "Source files or directories separated by commas")
|
||||
@ValueDescription("<path[,]>")
|
||||
public String[] sourceFiles;
|
||||
|
||||
@Argument(value = "sourcemap", description = "Generate SourceMap")
|
||||
public boolean sourcemap;
|
||||
|
||||
@Argument(value = "target", description = "Generate JS files for specific ECMA version (only ECMA 5 is supported)")
|
||||
@ValueDescription("<version>")
|
||||
public String target;
|
||||
|
||||
@Nullable
|
||||
@Argument(value = "main", description = "Whether a main function should be called; either '" + CALL +
|
||||
"' or '" + NO_CALL + "', default '" + CALL + "' (main function will be auto detected)")
|
||||
@Argument(value = "main", description = "Whether a main function should be called; default '" + CALL + "' (main function will be auto detected)")
|
||||
@ValueDescription("{" + CALL + "," + NO_CALL + "}")
|
||||
public String main;
|
||||
|
||||
@Argument(value = "outputPrefix", description = "Path to file which will be added to the beginning of output file")
|
||||
@ValueDescription("<path>")
|
||||
public String outputPrefix;
|
||||
|
||||
@Argument(value = "outputPostfix", description = "Path to file which will be added to the end of output file")
|
||||
@ValueDescription("<path>")
|
||||
public String outputPostfix;
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String executableScriptFileName() {
|
||||
return "kotlinc-js";
|
||||
}
|
||||
}
|
||||
|
||||
+16
-1
@@ -19,6 +19,7 @@
|
||||
package org.jetbrains.jet.cli.common.arguments;
|
||||
|
||||
import com.sampullara.cli.Argument;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Command line arguments for K2JVMCompiler
|
||||
@@ -26,18 +27,23 @@ import com.sampullara.cli.Argument;
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
public class K2JVMCompilerArguments extends CommonCompilerArguments {
|
||||
@Argument(value = "src", description = "Source file or directory (allows many paths separated by the system path separator)")
|
||||
@ValueDescription("<path>")
|
||||
public String src;
|
||||
|
||||
@Argument(value = "jar", description = "Resulting .jar file path")
|
||||
@ValueDescription("<path>")
|
||||
public String jar;
|
||||
|
||||
@Argument(value = "output", description = "Output directory path for .class files")
|
||||
@ValueDescription("<path>")
|
||||
public String outputDir;
|
||||
|
||||
@Argument(value = "classpath", description = "Paths where to find user class files")
|
||||
@ValueDescription("<path>")
|
||||
public String classpath;
|
||||
|
||||
@Argument(value = "annotations", description = "Paths to external annotations")
|
||||
@ValueDescription("<path>")
|
||||
public String annotations;
|
||||
|
||||
@Argument(value = "includeRuntime", description = "Include Kotlin runtime in to resulting .jar")
|
||||
@@ -59,14 +65,23 @@ public class K2JVMCompilerArguments extends CommonCompilerArguments {
|
||||
public boolean notNullParamAssertions;
|
||||
|
||||
@Argument(value = "module", description = "Path to the module file to compile")
|
||||
@ValueDescription("<path>")
|
||||
public String module;
|
||||
|
||||
@Argument(value = "script", description = "Evaluate the script file")
|
||||
public boolean script;
|
||||
|
||||
@Argument(value = "kotlinHome", description = "Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery")
|
||||
@ValueDescription("<path>")
|
||||
public String kotlinHome;
|
||||
|
||||
@Argument(value = "inline", description = "Inlining mode: on/off (default is on)")
|
||||
@Argument(value = "inline", description = "Inlining mode (default is on)")
|
||||
@ValueDescription("{on,off}")
|
||||
public String inline;
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String executableScriptFileName() {
|
||||
return "kotlinc-jvm";
|
||||
}
|
||||
}
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright 2010-2014 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;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface ValueDescription {
|
||||
@NotNull
|
||||
String value();
|
||||
}
|
||||
Reference in New Issue
Block a user