You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The makeUsage command is private it should be protected so that sub classes can call it.
My usecase is that I have a subcommand that itself has subcommands, and if executed without a subcommand I want it to print the help message, e.g. cli sc prints help cli sc ssc does something.
My workaround is this.
import kotlinx.cli.*
import kotlin.reflect.full.*
class NewSubCommand: Subcommand("sc", "sc") {
override fun execute() {
// Print Help
ArgParser::class.declaredFunctions.find { it.name == "makeUsage" }?.let {
println(it.call(tiz))
}
}
}
Another workaround might be to throw an error with:
override fun execute() {
throw ParsingException("Needs Sub command")
}
but I think this is also not a great workaround.
The text was updated successfully, but these errors were encountered:
The makeUsage command is
private
it should beprotected
so that sub classes can call it.My usecase is that I have a subcommand that itself has subcommands, and if executed without a subcommand I want it to print the help message, e.g.
cli sc
prints helpcli sc ssc
does something.My workaround is this.
Another workaround might be to throw an error with:
but I think this is also not a great workaround.
The text was updated successfully, but these errors were encountered: