public static void main(String[] args) {
    int port = ThumbnailServer.PORT;
    int width = ThumbnailServer.WIDTH;
    int height = ThumbnailServer.HEIGHT;
    int threads = ThumbnailerService.THREADS;
    boolean resize = true;
    for (int i = 0; i < args.length; i++) {
      switch(args[i]) {
        case "--help":
        case "-h":
          usage();
          System.exit(0);
        case "--port":
          i += 1;
          port = Integer.parseInt(args[i]);
          break;
        case "--width":
          i += 1;
          width = Integer.parseInt(args[i]);
          break;
        case "--height":
          i += 1;
          height = Integer.parseInt(args[i]);
          break;
        case "--no-resize":
          resize = false;
          break;
        case "--threads":
          i += 1;
          threads = Integer.parseInt(args[i]);
          break;
        case "--silent":
          LogManager.getLogManager().reset();
        default:
          System.err.println("Unrecognized argument: " + args[i]);
          usage();
      }
    }    
    ThumbnailServer server = new ThumbnailServer(port, threads, width, height, resize);
    server.run();
  }