operator [] method

dynamic operator [] (
  1. String name
)

Gets the parsed command-line option named name.

Implementation

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

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