option method

String? option(
  1. String name
)

Returns the parsed or default command-line option named name.

name must be a valid option name in the parser.

Implementation

String? option(String name) {
  var option = _parser.options[name];
  if (option == null) {
    throw ArgumentError('Could not find an option named "--$name".');
  }
  if (!option.isSingle) {
    throw ArgumentError('"$name" is a multi-option.');
  }
  return option.valueOrDefault(_parsed[name]) as String?;
}