addSubcommand method

void addSubcommand(
  1. Command<ExitCode> command
)
inherited

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;
}