single.c 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include <stdio.h>
  2. #include <unistd.h>
  3. #include <libnet.h>
  4. #include "util.h"
  5. #include "postprocess.h"
  6. int
  7. main(int argc, char *argv[])
  8. {
  9. int opt;
  10. int verbose = 0;
  11. int quality = 90;
  12. char *input_path;
  13. char *output_path;
  14. while ((opt = getopt(argc, argv, "vq:")) != -1) {
  15. switch (opt) {
  16. case 'v':
  17. verbose = 1;
  18. break;
  19. case 'q':
  20. quality = atoi(optarg);
  21. break;
  22. case 'i':
  23. printf("input: %s\n", argv[optind]);
  24. input_path = argv[optind];
  25. break;
  26. case 'o':
  27. printf("output: %s\n", argv[optind]);
  28. output_path = argv[optind];
  29. break;
  30. case '?':
  31. printf("WTF\n");
  32. break;
  33. }
  34. }
  35. input_path = argv[optind];
  36. output_path = argv[optind + 1];
  37. postprocess_setup();
  38. postprocess_single(input_path, output_path, quality, verbose);
  39. return 0;
  40. }