addSubcommand method

void addSubcommand (
  1. Command<T> command
)

Adds Command as a subcommand of this.

Implementation

void addSubcommand(Command<T> command) {
  var names = [command.name, ...command.aliases];
  for (var name in names) {
    _subcommands[name] = command;
    argParser.addCommand(name, command.argParser);
  }
  command._parent = this;
}