diff --git a/src/commonMain/kotlin/jvm.kt b/src/commonMain/kotlin/jvm.kt index 2982b11..f0d0d7e 100644 --- a/src/commonMain/kotlin/jvm.kt +++ b/src/commonMain/kotlin/jvm.kt @@ -20,7 +20,7 @@ class JvmRuntimeConfig(recognizedArgs: Array) : var java: JavaInstallation? = null override val supportedDirectives: DirectivesMap = mutableMapOf( - "dry-run" to { printlnErr(dryRun()) }, + "dry-run" to { args -> printlnErr(dryRun(args)) }, "print-class-path" to { printlnErr(classpath() ?: "") }, "print-java-home" to { printlnErr(javaHome()) }, "print-java-info" to { printlnErr(javaInfo()) }, @@ -159,12 +159,12 @@ class JvmRuntimeConfig(recognizedArgs: Array) : return classpathArg.substring(prefix.length).replace(COLON, divider) } - fun dryRun(): String { + fun dryRun(args: ProgramArgs): String { return buildString { append(java?.binJava ?: "java") - runtimeArgs.forEach { append(" $it") } + args.runtime.forEach { append(" $it") } append(" $mainProgram") - mainArgs.forEach { append(" $it") } + args.main.forEach { append(" $it") } } } diff --git a/src/commonMain/kotlin/python.kt b/src/commonMain/kotlin/python.kt index 24d0143..556877c 100644 --- a/src/commonMain/kotlin/python.kt +++ b/src/commonMain/kotlin/python.kt @@ -15,7 +15,7 @@ class PythonRuntimeConfig(recognizedArgs: Array) : var python: PythonInstallation? = null override val supportedDirectives: DirectivesMap = mutableMapOf( - "dry-run" to { printlnErr(dryRun()) }, + "dry-run" to { args -> printlnErr(dryRun(args)) }, "print-python-home" to { printlnErr(pythonHome()) }, "print-python-info" to { printlnErr(pythonInfo()) }, ) @@ -110,12 +110,12 @@ class PythonRuntimeConfig(recognizedArgs: Array) : // -- Directive handlers -- - fun dryRun(): String { + fun dryRun(args: ProgramArgs): String { return buildString { append(python?.binPython ?: "python") - runtimeArgs.forEach { append(" $it") } + args.runtime.forEach { append(" $it") } append(" $mainProgram") - mainArgs.forEach { append(" $it") } + args.main.forEach { append(" $it") } } }