Kotlin / kotlin-interactive-shell

Kotlin Language Interactive Shell
Apache License 2.0
588 stars 36 forks source link

Raises an exception with help option flag #102

Open binkley opened 2 years ago

binkley commented 2 years ago

After a new installation with Homebrew, this was a surprising result:

$ ki -h
Usage: ki [-h] [--version] 

  -h, --help                Prints help
  --version                 Print version
Exception in thread "main" kotlinx.cli.HelpPrintedException
    at kotlinx.cli.FlagArgumentsKt$help$1.invoke(FlagArguments.kt:96)
    at kotlinx.cli.FlagAction$DefaultImpls.invoke(Actions.kt:9)
    at kotlinx.cli.FlagActionBase.invoke(FlagArguments.kt:4)
    at kotlinx.cli.CommandLineParser.doParse(CommandLineParser.kt:56)
    at kotlinx.cli.CommandLineParser.parseTokenized(CommandLineParser.kt:21)
    at kotlinx.cli.CommandLineParser.parse(CommandLineParser.kt:11)
    at kotlinx.cli.CommandLineParser.parse(CommandLineParser.kt:7)
    at kotlinx.cli.ParseKt.parse(parse.kt:8)
    at org.jetbrains.kotlinx.ki.shell.KotlinShell.main(KotlinShell.kt:22)
binkley commented 2 years ago

(An aside -- I see you're using JLine3, such a nice library! You might consider handling command-line option flags with Picocli via the picocli-shell-jline3 dependency. The two libraries work together nicely by design.)