public DownloadModeArguments(Logger logger, Settings delegate, List<String> options) {
      super(logger, delegate.offlineMode());

      // parse --download=/some/local/path
      String path = null;
      for (String option : options) {
        if (option.startsWith("--download=")) {
          path = option.substring("--download=".length());
        }
      }
      checkArgument(
        path != null && !path.isEmpty(),
        "Must specify a local download directory"
      );
      this.localDownloadDir = path;
      this.delegate = checkNotNull(delegate, "delegate");
    }