diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt index 9a35458b42e..2e2b92213dc 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt @@ -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? by FreezableVar(null) @Argument( diff --git a/compiler/cli/cli-runner/src/org/jetbrains/kotlin/runner/runners.kt b/compiler/cli/cli-runner/src/org/jetbrains/kotlin/runner/runners.kt index 450612c2949..9f1b9661cc4 100644 --- a/compiler/cli/cli-runner/src/org/jetbrains/kotlin/runner/runners.kt +++ b/compiler/cli/cli-runner/src/org/jetbrains/kotlin/runner/runners.kt @@ -152,7 +152,7 @@ class ExpressionRunner(private val code: List) : RunnerWithCompiler() { val compilerArgs = ArrayList().apply { addClasspathArgIfNeeded(classpath) code.forEach { - add("-expression") + add("-Xexpression") add(it) } addAll(arguments) diff --git a/compiler/testData/cli/jvm/extraHelp.out b/compiler/testData/cli/jvm/extraHelp.out index f52ea5f6e5e..de73f6c090f 100644 --- a/compiler/testData/cli/jvm/extraHelp.out +++ b/compiler/testData/cli/jvm/extraHelp.out @@ -18,6 +18,7 @@ where advanced options include: 'enable' since language version 1.3 -Xdump-declarations-to= 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= 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 diff --git a/compiler/testData/cli/jvm/help.out b/compiler/testData/cli/jvm/help.out index 30211de5171..e3dc1f09062 100644 --- a/compiler/testData/cli/jvm/help.out +++ b/compiler/testData/cli/jvm/help.out @@ -2,7 +2,6 @@ Usage: kotlinc-jvm where possible options include: -classpath (-cp) List of directories and JAR/ZIP archives to search for user class files -d 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 Include a custom JDK from the specified location into the classpath instead of the default JAVA_HOME diff --git a/plugins/scripting/scripting-compiler/tests/org/jetbrains/kotlin/scripting/compiler/plugin/ScriptingWithCliCompilerTest.kt b/plugins/scripting/scripting-compiler/tests/org/jetbrains/kotlin/scripting/compiler/plugin/ScriptingWithCliCompilerTest.kt index e34d82eead6..e8b889f462c 100644 --- a/plugins/scripting/scripting-compiler/tests/org/jetbrains/kotlin/scripting/compiler/plugin/ScriptingWithCliCompilerTest.kt +++ b/plugins/scripting/scripting-compiler/tests/org/jetbrains/kotlin/scripting/compiler/plugin/ScriptingWithCliCompilerTest.kt @@ -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",