public static void main(String[] args) {
    if (args.length < 2) {
      System.err.println("Usage: compare [options] {path/to/archive1} {path/to/archive2}");
      System.exit(1);
    }
    // last 2 args are paths to the archives
    String inputString1 = args[args.length - 2];
    String inputString2 = args[args.length - 1];
    var arguments = Arguments.fromArgsOrConfigFile(Arrays.copyOf(args, args.length - 2));
    var verbose = arguments.getBoolean("verbose", "log each tile diff", false);
    var strict = arguments.getBoolean("strict", "set to false to only fail on tile diffs", true);
    var config = PlanetilerConfig.from(arguments);
    var input1 = TileArchiveConfig.from(inputString1);
    var input2 = TileArchiveConfig.from(inputString2);

    try {
      var result = compare(input1, input2, config, verbose);

      var format = Format.defaultInstance();
      if (LOGGER.isInfoEnabled()) {
        LOGGER.info("Detailed diffs:");
        for (var entry : result.tileDiffsByLayer.entrySet()) {
          LOGGER.info("  \"{}\" layer", entry.getKey());
          for (var layerEntry : entry.getValue().entrySet().stream().sorted(Map.Entry.comparingByValue()).toList()) {
            LOGGER.info("    {}: {}", layerEntry.getKey(), format.integer(layerEntry.getValue()));
          }
        }
        for (var entry : result.tileDiffTypes.entrySet().stream().sorted(Map.Entry.comparingByValue()).toList()) {
          LOGGER.info("  {}: {}", entry.getKey(), format.integer(entry.getValue()));
        }
        for (var diffType : result.archiveDiffs) {
          LOGGER.info("  {}", diffType);
        }
        LOGGER.info("Total tiles: {}", format.integer(result.total));
        LOGGER.info("Tile diffs: {} ({} of all tiles)", format.integer(result.tileDiffs),
          format.percent(result.tileDiffs * 1d / result.total));
      }
      System.exit((result.tileDiffs > 0 || (strict && !result.archiveDiffs.isEmpty())) ? 1 : 0);
    } catch (FatalComparisonFailure e) {
      LOGGER.error("Error comparing archives {}", e.getMessage());
      System.exit(1);
    }
  }
@throws FatalComparisonFailure if a comparison failure is encountered that prevents comparing the whole archives.
planetiler-core/src/main/java/com/onthegomap/planetiler/util/CompareArchives.java