wasParsed method

bool wasParsed(
  1. String name
)

Returns true if the option with name was parsed from an actual argument.

Returns false if it wasn't provided and the default value or no default value would be used instead.

name must be a valid option name in the parser.

Implementation

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

  return _parsed.containsKey(name);
}