Switch cli expression evaluation argument syntax to -expression/-e
#KT-35414 fixed
This commit is contained in:
+5
-1
@@ -49,7 +49,11 @@ 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 = "-Xexpression", description = "Evaluate the given string as a Kotlin script")
|
||||
@Argument(
|
||||
value = "-expression",
|
||||
shortName = "-e",
|
||||
description = "Evaluate the given string as a Kotlin script"
|
||||
)
|
||||
var expression: String? by FreezableVar(null)
|
||||
|
||||
@Argument(
|
||||
|
||||
@@ -151,7 +151,8 @@ class ExpressionRunner(private val code: String) : RunnerWithCompiler() {
|
||||
override fun run(classpath: List<URL>, arguments: List<String>, compilerClasspath: List<URL>) {
|
||||
val compilerArgs = ArrayList<String>().apply {
|
||||
addClasspathArgIfNeeded(classpath)
|
||||
add("-Xexpression=$code")
|
||||
add("-expression")
|
||||
add(code)
|
||||
addAll(arguments)
|
||||
}
|
||||
runCompiler(compilerClasspath, compilerArgs)
|
||||
|
||||
Reference in New Issue
Block a user