Verify bittorrent .torrent metainfo files.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
879B

  1. #include "opts.h"
  2. #include <unistd.h>
  3. int opt_silent = 0;
  4. int opt_showinfo = 0;
  5. int opt_help = 0;
  6. int opt_no_use_dir = 0;
  7. int opt_pretty_progress = 0;
  8. char* opt_data_path = NULL;
  9. int opts_parse(int argc, char** argv) {
  10. int opt;
  11. while ((opt = getopt(argc, argv, "pnihsv:")) != -1) {
  12. switch (opt) {
  13. case 'i':
  14. opt_showinfo = 1;
  15. break;
  16. case 'h':
  17. opt_help = 1;
  18. break;
  19. case 's':
  20. opt_silent = 1;
  21. break;
  22. case 'n':
  23. opt_no_use_dir = 1;
  24. break;
  25. case 'p':
  26. opt_pretty_progress = 1;
  27. break;
  28. case 'v':
  29. opt_data_path = optarg;
  30. break;
  31. default:
  32. return -1;
  33. }
  34. }
  35. return 0;
  36. }