Reproducer:
private val param = Options.text("param")
override def cliApp: CliApp[Any with ZIOAppArgs with Scope, Any, Any] =
CliApp.make(
"test",
"0.1.0",
HelpDoc.Span.text("Reproduce --help issue"),
command = Command("test", param).subcommands(
Command("a")
.subcommands(
Command("b")
)
.map { _ => () }
)
) { _ => ZIO.unit }
Expected behaviour: result for a --help and --param text a --help should be the same - help for a subcommand.
Actual result: --param text a --help shows root doc instead.
Correct result:
$ ./bin/test a --help
...
USAGE
$ test a b
COMMANDS
b
Incorrect result:
$ ./bin/test --param text a --help
...
USAGE
$ test --param text a b
OPTIONS
--param text
A user-defined piece of text.
COMMANDS
a
See minimal reproducer here: https://github.com/senia-psm/zio-cli-222