validateOutputDirectoryArg method

void validateOutputDirectoryArg()

Implementation

void validateOutputDirectoryArg() {
  if (argResults?.rest.isEmpty ?? false) {
    throw UsageException('No option specified for the output directory.', usage);
  }

  if (argResults!.rest.length > 1) {
    String message = 'Multiple output directories specified.';
    for (final String arg in argResults!.rest) {
      if (arg.startsWith('-')) {
        message += '\nTry moving $arg to be immediately following $name';
        break;
      }
    }
    throw FormatException(message);
  }
}