I have a command defined like so:
@HelpMessage("help-4")
case object Build extends Command[CommonOptions]:
override def names: List[List[String]] = List(List("build"))
override def help =
super.help.copy(helpMessage = Some(HelpMessage("help-1", "help-2", "help-3")))
override def run(options: CommonOptions, remainingArgs: RemainingArgs): Unit = ???
And neither of help-* messages are printed when I run the app with --help or build --help.
I've managed to get help-1 text printed for this command with an ovveride in CommandsEntryPoint:
object Main extends CommandsEntryPoint:
override val commands = List(
Build
)
override def help: RuntimeCommandsHelp =
super.help.copy(commands = commands.map(cmd => RuntimeCommandHelp(cmd.names, cmd.help, cmd.group, cmd.hidden)))
The only change in the override from the default is cmd.finalHelp was changed to cmd.help.
I think there is an issue with finalHelp implementation, which in 2.1.0-M29 is:
lazy val finalHelp: Help[_] = {
val h =
if (hasFullHelp) messages.withFullHelp
else if (hasHelp) messages.withHelp
else messages
if (name == h.progName) h
else h.withProgName(name)
}
I think that instead of referencing messages it should instead reference help so that it's possible to modify it.
I have a command defined like so:
And neither of
help-*messages are printed when I run the app with--helporbuild --help.I've managed to get
help-1text printed for this command with an ovveride inCommandsEntryPoint:The only change in the override from the default is
cmd.finalHelpwas changed tocmd.help.I think there is an issue with
finalHelpimplementation, which in2.1.0-M29is:I think that instead of referencing
messagesit should instead referencehelpso that it's possible to modify it.