External register subcommand will not be called to initialize method
Closed this issue · 1 comments
lgou2w commented
When a subcommand is not registered in the initialize of the parent command, the subcommand is not initialized.
See below:
manager.registerCommand(RootCommand()).apply {
// bug, does not call the initialize of this SubCommand
registerChild(SubCommand())
}
Temporary solution:
class RootCommand : StandardCommand() {
override fun initialize() {
super.initialize()
command.registerChild(SubCommand()) // ok, no problem
}
}
lgou2w commented
Will release the fixed version in 0.1.7-rc5
.