A clone of btpd with my configuration changes.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

43 řádky
803 B

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