register

open inline override fun register(parentBuilder: ArgumentBuilder<S, *>, action: ArgumentBuilder<S, *>.(ArgumentAccessor<S, D>?) -> Unit)

Registers the argument on the parentBuilder as an optional argument and further configures the resulting subcommands with the given action.

The action is called once on the argument's builder, and once on the parent builder, creating a branching path.

On the path where the argument is present, the accessor passed to action is not null and can be used on a CommandContext within an execute block to obtain an ArgumentReader for this argument.

On the path where the argument is not present, the argument passed to action is instead null.

Author

Cypher121