operator [] method

dynamic operator [] (String name)

Gets the parsed command-line option named name.

Implementation

operator [](String name) {
  if (!_parser.options.containsKey(name)) {
    throw ArgumentError('Could not find an option named "$name".');
  }

  return _parser.options[name].getOrDefault(_parsed[name]);
}