A clone of btpd with my configuration changes.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

42 lignes
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. }