addCommand method

void addCommand(
  1. Command<T> command
)

Adds Command as a top-level command to this runner.

Implementation

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