Changeset 13736
- Timestamp:
- Jan 3, 2013, 5:10:47 AM (8 years ago)
- Location:
- trunk/daemon
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/remote.c
r13683 r13736 555 555 addIdArg (tr_variant * args, const char * id) 556 556 { 557 if (!*id) 558 { 559 fprintf ( 560 stderr, 561 "No torrent specified! Please use the -t option first.\n"); 562 id = "-1"; /* no torrent will have this ID, so should be a no-op */ 563 } 564 if (strcmp (id, "all")) 565 { 566 const char * pch; 567 bool isList = strchr (id,',') || strchr (id,'-'); 568 bool isNum = true; 569 for (pch=id; isNum && *pch; ++pch) 570 if (!isdigit (*pch)) 571 isNum = false; 572 if (isNum || isList) 573 tr_rpc_parse_list_str (tr_variantDictAdd (args, TR_KEY_ids), id, strlen (id)); 574 else 575 tr_variantDictAddStr (args, TR_KEY_ids, id); /* it's a torrent sha hash */ 557 if (!*id) 558 { 559 fprintf (stderr, "No torrent specified! Please use the -t option first.\n"); 560 id = "-1"; /* no torrent will have this ID, so should be a no-op */ 561 } 562 else if (!tr_strcmp0 (id, "active")) 563 { 564 tr_variantDictAddStr (args, TR_KEY_ids, "recently-active"); 565 } 566 else if (strcmp (id, "all")) 567 { 568 const char * pch; 569 bool isList = strchr (id,',') || strchr (id,'-'); 570 bool isNum = true; 571 572 for (pch=id; isNum && *pch; ++pch) 573 if (!isdigit (*pch)) 574 isNum = false; 575 576 if (isNum || isList) 577 tr_rpc_parse_list_str (tr_variantDictAdd (args, TR_KEY_ids), id, strlen (id)); 578 else 579 tr_variantDictAddStr (args, TR_KEY_ids, id); /* it's a torrent sha hash */ 576 580 } 577 581 } … … 1982 1986 n = TR_N_ELEMENTS (list_keys); 1983 1987 for (i=0; i<n; ++i) tr_variantListAddQuark (fields, list_keys[i]); 1988 addIdArg (args, id); 1984 1989 break; 1985 1990 case 940: tr_variantDictAddInt (top, TR_KEY_tag, TAG_FILES); -
trunk/daemon/transmission-remote.1
r13691 r13736 58 58 .Op Fl si 59 59 .Op Fl st 60 .Op Fl t Ar all | Ar id | Ar hash60 .Op Fl t Ar all | active | Ar id | Ar hash 61 61 .Op Fl hl 62 62 .Op Fl HL … … 257 257 .It Fl -no-start-paused 258 258 Start added torrents unpaused 259 .It Fl t Fl -torrent Ar all | id | torrent-hash260 Set the current torrent(s) for use by subsequent options. 259 .It Fl t Fl -torrent Ar all | active | id | torrent-hash 260 Set the current torrent(s) for use by subsequent options. The literal 261 261 .Ar all 262 will apply following requests to all torrents, while specific torrents can be chosen by 262 will apply following requests to all torrents; the literal 263 .Ar active 264 will apply following requests to recently-active torrents; and specific torrents can be chosen by 263 265 .Ar id 264 266 or … … 319 321 .El 320 322 .Sh EXAMPLES 323 List all torrents: 324 .Bd -literal -offset indent 325 $ transmission-remote \-l 326 .Ed 327 List all active torrents: 328 .Bd -literal -offset indent 329 $ transmission-remote \-tactive \-l 330 .Ed 321 331 Set download and upload limits to 400 kB/sec and 60 kB/sec: 322 332 .Bd -literal -offset indent
Note: See TracChangeset
for help on using the changeset viewer.