A clone of btpd with my configuration changes.
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
782 B

  1. #include "btcli.h"
  2. void
  3. usage_del(void)
  4. {
  5. printf(
  6. "Remove torrents from btpd.\n"
  7. "\n"
  8. "Usage: del torrent ...\n"
  9. "\n"
  10. "Arguments:\n"
  11. "torrent ...\n"
  12. "\tThe torrents to remove.\n"
  13. "\n");
  14. exit(1);
  15. }
  16. static struct option del_opts [] = {
  17. { "help", no_argument, NULL, 'H' },
  18. {NULL, 0, NULL, 0}
  19. };
  20. void
  21. cmd_del(int argc, char **argv)
  22. {
  23. int ch;
  24. struct ipc_torrent t;
  25. while ((ch = getopt_long(argc, argv, "", del_opts, NULL)) != -1)
  26. usage_del();
  27. argc -= optind;
  28. argv += optind;
  29. if (argc < 1)
  30. usage_del();
  31. btpd_connect();
  32. for (int i = 0; i < argc; i++)
  33. if (torrent_spec(argv[i], &t))
  34. handle_ipc_res(btpd_del(ipc, &t), "del", argv[i]);
  35. }