static tr_option opts[] =
{
- { 'a', "add", "Add torrent files",
- "a", 0, NULL },
- { 'b', "debug", "Print debugging information",
- "b", 0, NULL },
- { 'd', "downlimit", "Set the maximum global download speed in KB/s",
- "d", 1, "<speed>" },
- { 'D', "no-downlimit", "Don't limit the global download speed",
- "D", 0, NULL },
- { 910, "encryption-required", "Encrypt all peer connections",
- "er", 0, NULL },
- { 911, "encryption-preferred", "Prefer encrypted peer connections",
- "ep", 0, NULL },
- { 912, "encryption-tolerated", "Prefer unencrypted peer connections",
- "et", 0, NULL },
- { 'f', "files", "List the current torrent's files",
- "f", 0, NULL },
- { 'g', "get", "Mark files for download",
- "g", 1, "<files>" },
- { 'G', "no-get", "Mark files for not downloading",
- "G", 1, "<files>" },
- { 'i', "info", "Show details of the current torrent(s)",
- "i", 0, NULL },
- { 'l', "list", "List all torrents",
- "l", 0, NULL },
- { 'm', "portmap", "Enable portmapping via NAT-PMP or UPnP",
- "m", 0, NULL },
- { 'M', "no-portmap", "Disable portmapping",
- "M", 0, NULL },
- { 'n', "auth", "Set authentication info",
- "n", 1, "<username:password>" },
- { 'p', "port",
- "Port for incoming peers (Default: " TR_DEFAULT_PEER_PORT_STR ")",
- "p", 1, "<port>" },
- { 900, "priority-high", "Set the files' priorities as high",
- "ph", 1, "<files>" },
- { 901, "priority-normal", "Set the files' priorities as normal",
- "pn", 1, "<files>" },
- { 902, "priority-low", "Set the files' priorities as low",
- "pl", 1, "<files>" },
- { 'r', "remove", "Remove the current torrent(s)",
- "r", 0, NULL },
- { 'R', "remove-and-delete", "Remove the current torrent(s) and delete local data",
- NULL, 0, NULL },
- { 's', "start", "Start the current torrent(s)",
- "s", 0, NULL },
- { 'S', "stop", "Stop the current torrent(s)",
- "S", 0, NULL },
- { 't', "torrent", "Set the current torrent(s)",
- "t", 1, "<torrent>" },
- { 'u', "uplimit", "Set the maximum global upload speed in KB/s",
- "u", 1, "<speed>" },
- { 'U', "no-uplimit", "Don't limit the global upload speed",
- "U", 0, NULL },
- { 'v', "verify", "Verify the current torrent(s)",
- "v", 0, NULL },
- { 'w', "download-dir", "Set the default download folder",
- "w", 1, "<path>" },
- { 'x', "pex", "Enable peer exchange (PEX)",
- "x", 0, NULL },
- { 'X', "no-pex", "Disable peer exchange (PEX)",
- "X", 0, NULL },
- { 'z', "peers", "List the current torrent's peers",
- "z", 0, NULL },
- { 0, NULL, NULL,
- NULL, 0, NULL }
+ { 'a', "add", "Add torrent files", "a", 0, NULL },
+ { 'b', "debug", "Print debugging information", "b", 0, NULL },
+ { 'd', "downlimit", "Set the maximum global download speed in KB/s", "d", 1, "<speed>" },
+ { 'D', "no-downlimit", "Don't limit the global download speed", "D", 0, NULL },
+ { 910, "encryption-required", "Encrypt all peer connections", "er", 0, NULL },
+ { 911, "encryption-preferred", "Prefer encrypted peer connections", "ep", 0, NULL },
+ { 912, "encryption-tolerated", "Prefer unencrypted peer connections", "et", 0, NULL },
+ { 'f', "files", "List the current torrent's files", "f", 0, NULL },
+ { 'g', "get", "Mark files for download", "g", 1, "<files>" },
+ { 'G', "no-get", "Mark files for not downloading", "G", 1, "<files>" },
+ { 'i', "info", "Show details of the current torrent(s)", "i", 0, NULL },
+ { 'l', "list", "List all torrents", "l", 0, NULL },
+ { 'm', "portmap", "Enable portmapping via NAT-PMP or UPnP", "m", 0, NULL },
+ { 'M', "no-portmap", "Disable portmapping", "M", 0, NULL },
+ { 'n', "auth", "Set authentication info", "n", 1, "<username:password>" },
+ { 'p', "port", "Port for incoming peers (Default: " TR_DEFAULT_PEER_PORT_STR ")", "p", 1, "<port>" },
+ { 900, "priority-high", "Set the files' priorities as high", "ph", 1, "<files>" },
+ { 901, "priority-normal", "Set the files' priorities as normal", "pn", 1, "<files>" },
+ { 902, "priority-low", "Set the files' priorities as low", "pl", 1, "<files>" },
+ { 'r', "remove", "Remove the current torrent(s)", "r", 0, NULL },
+ { 'R', "remove-and-delete", "Remove the current torrent(s) and delete local data", NULL, 0, NULL },
+ { 's', "start", "Start the current torrent(s)", "s", 0, NULL },
+ { 'S', "stop", "Stop the current torrent(s)", "S", 0, NULL },
+ { 't', "torrent", "Set the current torrent(s)", "t", 1, "<torrent>" },
+ { 'u', "uplimit", "Set the maximum global upload speed in KB/s", "u", 1, "<speed>" },
+ { 'U', "no-uplimit", "Don't limit the global upload speed", "U", 0, NULL },
+ { 'v', "verify", "Verify the current torrent(s)", "v", 0, NULL },
+ { 'w', "download-dir", "Set the default download folder", "w", 1, "<path>" },
+ { 'x', "pex", "Enable peer exchange (PEX)", "x", 0, NULL },
+ { 'X', "no-pex", "Disable peer exchange (PEX)", "X", 0, NULL },
+ { 'z', "peers", "List the current torrent's peers", "z", 0, NULL },
+ { 0, NULL, NULL, NULL, 0, NULL }
};
static void
#define TR_N_ELEMENTS( ary ) ( sizeof( ary ) / sizeof( *ary ) )
static const char * files_keys[] = {
- "files", "name", "priorities", "wanted"
+ "files",
+ "name",
+ "priorities",
+ "wanted"
};
static const char * details_keys[] = {
- "activityDate", "addedDate", "announceResponse",
+ "activityDate",
+ "addedDate",
+ "announceResponse",
"announceURL",
- "comment", "corruptEver", "creator",
- "dateCreated", "doneDate",
- "downloadedEver", "errorString", "eta",
- "hashString", "haveUnchecked",
- "haveValid", "id", "isPrivate",
- "lastAnnounceTime", "lastScrapeTime",
- "leechers", "leftUntilDone", "name",
- "nextAnnounceTime", "nextScrapeTime",
- "peersConnected", "peersGettingFromUs", "peersSendingToUs",
- "pieceCount", "pieceSize", "rateDownload",
- "rateUpload", "recheckProgress",
- "scrapeResponse", "seeders",
- "sizeWhenDone", "startDate",
- "status", "timesCompleted", "totalSize",
+ "comment",
+ "corruptEver",
+ "creator",
+ "dateCreated",
+ "doneDate",
+ "downloadDir",
+ "downloadedEver",
+ "errorString",
+ "eta",
+ "hashString",
+ "haveUnchecked",
+ "haveValid",
+ "id",
+ "isPrivate",
+ "lastAnnounceTime",
+ "lastScrapeTime",
+ "leechers",
+ "leftUntilDone",
+ "name",
+ "nextAnnounceTime",
+ "nextScrapeTime",
+ "peersConnected",
+ "peersGettingFromUs",
+ "peersSendingToUs",
+ "pieceCount",
+ "pieceSize",
+ "rateDownload",
+ "rateUpload",
+ "recheckProgress",
+ "scrapeResponse",
+ "seeders",
+ "sizeWhenDone",
+ "startDate",
+ "status",
+ "timesCompleted",
+ "totalSize",
"uploadedEver",
- "webseeds", "webseedsSendingToUs"
+ "webseeds",
+ "webseedsSendingToUs"
};
static const char * list_keys[] = {
getStatusString( t, buf, sizeof( buf ) );
printf( " State: %s\n", buf );
+ if( tr_bencDictFindStr( t, "downloadDir", &str ) )
+ printf( " Location: %s\n", str );
+
if( tr_bencDictFindInt( t, "sizeWhenDone", &i )
&& tr_bencDictFindInt( t, "leftUntilDone", &j ) )
{