registerSubCommand method

void registerSubCommand (
  1. String name,
  2. CommandHandlerFunction commandHandler,
  3. {PassHandlerFunction beforeHandler,
  4. AfterHandlerFunction afterHandler}
)

Registers subcommand

Implementation

void registerSubCommand(String name, CommandHandlerFunction commandHandler,
    {PassHandlerFunction? beforeHandler, AfterHandlerFunction? afterHandler}) {
  this._commandEntities.add(
      BasicCommandHandler(name, commandHandler, beforeHandler: beforeHandler, afterHandler: afterHandler, parent: this));

  // TODO: That is not most efficient way
  this._commandEntities.sort((a, b) => -a.name.compareTo(b.name));
}