From 03d67a2eab668fed1fb93b3078f1c0387166ac11 Mon Sep 17 00:00:00 2001 From: Pasha Finkelshteyn Date: Tue, 28 Jun 2022 09:52:28 +0300 Subject: [PATCH] Fixes errors on each execution --- .../kotlin/org/jetbrains/kotlinx/ki/shell/KotlinShell.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/KotlinShell.kt b/ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/KotlinShell.kt index 142bddb..80a9b14 100644 --- a/ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/KotlinShell.kt +++ b/ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/KotlinShell.kt @@ -1,6 +1,7 @@ package org.jetbrains.kotlinx.ki.shell import kotlinx.cli.CommandLineInterface +import kotlinx.cli.HelpPrintedException import kotlinx.cli.flagArgument import kotlinx.cli.parse import org.jetbrains.kotlinx.ki.shell.configuration.CachedInstance @@ -19,7 +20,11 @@ object KotlinShell { @JvmStatic fun main(args: Array) { - cli.parse(args) + try { + cli.parse(args) + }catch (e:HelpPrintedException){ + return + } if (version) { printVersion()