addCommand method

  1. @override
ArgParser addCommand(
  1. String name, [
  2. ArgParser? parser
])
override

Defines a command.

A command is a named argument which may in turn define its own options and subcommands using the given parser. If parser is omitted, implicitly creates a new one. Returns the parser for the command.

Note that adding commands this way will not impact the usage string. To add commands which are included in the usage string see CommandRunner.

Implementation

@override
ArgParser addCommand(String name, [ArgParser? parser]) {
  throw UnsupportedError("ArgParser.allowAnything().addCommands() isn't supported.");
}