[minor] Change expression evaluation cli argument to -Xexpression
This commit is contained in:
+1
-1
@@ -49,7 +49,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() {
|
||||
@Argument(value = "-no-reflect", description = "Don't automatically include Kotlin reflection into the classpath")
|
||||
var noReflect: Boolean by FreezableVar(false)
|
||||
|
||||
@Argument(value = "-expression", description = "Evaluate the given string as a Kotlin script")
|
||||
@Argument(value = "-Xexpression", description = "Evaluate the given string as a Kotlin script")
|
||||
var expressions: Array<String>? by FreezableVar(null)
|
||||
|
||||
@Argument(
|
||||
|
||||
@@ -152,7 +152,7 @@ class ExpressionRunner(private val code: List<String>) : RunnerWithCompiler() {
|
||||
val compilerArgs = ArrayList<String>().apply {
|
||||
addClasspathArgIfNeeded(classpath)
|
||||
code.forEach {
|
||||
add("-expression")
|
||||
add("-Xexpression")
|
||||
add(it)
|
||||
}
|
||||
addAll(arguments)
|
||||
|
||||
+1
@@ -18,6 +18,7 @@ where advanced options include:
|
||||
'enable' since language version 1.3
|
||||
-Xdump-declarations-to=<path> Path to JSON file to dump Java to Kotlin declaration mappings
|
||||
-Xdisable-standard-script Disable standard kotlin script support
|
||||
-Xexpression Evaluate the given string as a Kotlin script
|
||||
-Xfriend-paths=<path> Paths to output directories for friend modules (whose internals should be visible)
|
||||
-Xmultifile-parts-inherit Compile multifile classes as a hierarchy of parts and facade
|
||||
-Xir-check-local-names Check that names of local classes and anonymous objects are the same in the IR backend as in the old backend
|
||||
|
||||
Vendored
-1
@@ -2,7 +2,6 @@ Usage: kotlinc-jvm <options> <source files>
|
||||
where possible options include:
|
||||
-classpath (-cp) <path> List of directories and JAR/ZIP archives to search for user class files
|
||||
-d <directory|jar> Destination for generated class files
|
||||
-expression Evaluate the given string as a Kotlin script
|
||||
-include-runtime Include Kotlin runtime into the resulting JAR
|
||||
-java-parameters Generate metadata for Java 1.8 reflection on method parameters
|
||||
-jdk-home <path> Include a custom JDK from the specified location into the classpath instead of the default JAVA_HOME
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ class ScriptingWithCliCompilerTest {
|
||||
fun testExpression() {
|
||||
runWithK2JVMCompiler(
|
||||
arrayOf(
|
||||
"-expression",
|
||||
"-Xexpression",
|
||||
"val x = 7; println(x * 6); for (arg in args) println(arg)",
|
||||
"--",
|
||||
"hi",
|
||||
|
||||
Reference in New Issue
Block a user