Changeset 6300


Ignore:
Timestamp:
Jul 8, 2008, 6:12:36 PM (13 years ago)
Author:
charles
Message:

steal some blocklist/encryption options from remote & reuse them in cli

Location:
trunk/cli
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/cli/transmissioncli.1

    r6299 r6300  
    2525.Fl h
    2626.Nm
    27 .Op Fl v Ar level
    2827.Fl i
    2928.Ar torrent-file
    3029.Nm
    31 .Op Fl v Ar level
    3230.Fl s
    3331.Ar torrent-file
    3432.Nm
    35 .Op Fl v Ar level
    36 .Op Fl p Ar port
    37 .Op Fl d Ar number
    38 .Op Fl u Ar number
    39 .Op Fl f Ar script
    40 .Op Fl n
    41 .Ar torrent-file
    42 .Op Ar output-dir
    43 .Nm
    44 .Fl n Ar path
     33.Fl n Ar sourcefile
    4534.Op Fl a Ar url
    4635.Op Fl c Ar comment
    4736.Op Fl r
    48 .Ar output-file
     37.Ar new-torrent-file
     38.Nm
     39.Op options
     40.Ar torrent-file
    4941.Ek
    5042.Sh DESCRIPTION
     
    6052When creating a new torrent, set its announce URL
    6153
     54.It Fl b Fl -blocklist
     55Enable peer blocklists.  Transmission understands the bluetack blocklist file format.
     56New blocklists can be added by copying them into the config-dir's "blocklists" subdirectory.
     57
     58.It Fl B Fl -no-blocklist
     59Disble blocklists.
     60
    6261.It Fl c, Fl -comment Ar comment-text
    6362When creating a new torrent, set its comment field
     
    6867.It Fl D, -no-downlimit
    6968Don't limit the download speed
     69
     70.It Fl e Fl -encryption Ar required
     71Require all peer connections to be encrypted.
     72.It Fl e Fl -encryption Ar preferred
     73Prefer encrypted peer connections.
     74.It Fl e Fl -encryption Ar tolerated
     75Prefer unencrypted peer connections.
    7076
    7177.It Fl f, -finish Ar script
     
    8793Disable portmapping
    8894
    89 .It Fl n, Fl -new Ar path
     95.It Fl n, Fl -new Ar sourcefile
    9096Create torrent from the specified file or directory
    9197
     
    113119.It Fl w, Fl -download-dir Ar directory
    114120Where to save downloaded data.
    115 
    116 ccc
    117121
    118122.Sh SIGNALS
  • trunk/cli/transmissioncli.c

    r6299 r6300  
    3939#define MY_NAME "transmission-cli"
    4040
    41 static int           showInfo      = 0;
    42 static int           showScrape    = 0;
    43 static int           isPrivate     = 0;
    44 static int           verboseLevel  = 0;
    45 static int           peerPort      = TR_DEFAULT_PORT;
    46 static int           peerSocketTOS = TR_DEFAULT_PEER_SOCKET_TOS;
    47 static int           uploadLimit   = 20;
    48 static int           downloadLimit = -1;
    49 static int           natTraversal  = 0;
    50 static int           verify        = 0;
    51 static sig_atomic_t  gotsig        = 0;
    52 static sig_atomic_t  manualUpdate  = 0;
     41static int           showInfo         = 0;
     42static int           showScrape       = 0;
     43static int           isPrivate        = 0;
     44static int           verboseLevel     = 0;
     45static int           encryptionMode   = TR_ENCRYPTION_PREFERRED;
     46static int           peerPort         = TR_DEFAULT_PORT;
     47static int           peerSocketTOS    = TR_DEFAULT_PEER_SOCKET_TOS;
     48static int           blocklistEnabled = TR_DEFAULT_BLOCKLIST_ENABLED;
     49static int           uploadLimit      = 20;
     50static int           downloadLimit    = -1;
     51static int           natTraversal     = TR_DEFAULT_PORT_FORWARDING_ENABLED;
     52static int           verify           = 0;
     53static sig_atomic_t  gotsig           = 0;
     54static sig_atomic_t  manualUpdate     = 0;
    5355
    5456static const char   * torrentPath   = NULL;
     
    188190            natTraversal,                  /* nat enabled */
    189191            peerPort,
    190             TR_ENCRYPTION_PREFERRED,
     192            encryptionMode,
    191193            uploadLimit >= 0,
    192194            uploadLimit,
     
    196198            verboseLevel + 1,              /* messageLevel */
    197199            0,                             /* is message queueing enabled? */
    198             TR_DEFAULT_BLOCKLIST_ENABLED,
     200            blocklistEnabled,
    199201            peerSocketTOS,
    200202            TR_DEFAULT_RPC_ENABLED,
     
    440442
    441443const struct tr_option options[] = {
    442     { 'a', "announce",     "When creating a new torrent, set its announce URL",   "a", 1, "<url>" },
    443     { 'c', "comment",      "When creating a new torrent, set its comment field",  "c", 1, "<comment>" },
    444     { 'd', "downlimit",    "Set the maxiumum download speed in KB/s",             "d", 1, "<number>" },
    445     { 'D', "no-downlimit", "Don't limit the download speed",                      "D", 0, NULL },
    446     { 'f', "finish",       "Set a script to run when the torrent finishes",       "f", 1, "<script>" },
    447     { 'g', "config-dir",   "Where to look for configuration files",               "g", 1, "<path>" },
    448     { 'i', "info",         "Show torrent details and exit",                       "i", 0, NULL },
    449     { 'm', "portmap",      "Enable portmapping via NAT-PMP or UPnP",              "m", 0, NULL },
    450     { 'M', "no-portmap",   "Disable portmapping",                                 "M", 0, NULL },
    451     { 'n', "new",          "Create a new torrent from a file or directory",       "n", 1, "<path>" },
     444    { 'a', "announce",     "When creating a new torrent, set its announce URL",    "a", 1, "<url>" },
     445    { 'b', "blocklist",    "Enable peer blocklists",                               "b", 0, NULL },
     446    { 'B', "no-blocklist", "Disable peer blocklists",                              "B", 0, NULL },
     447    { 'c', "comment",      "When creating a new torrent, set its comment field",   "c", 1, "<comment>" },
     448    { 'd', "downlimit",    "Set the maxiumum download speed in KB/s",              "d", 1, "<number>" },
     449    { 'D', "no-downlimit", "Don't limit the download speed",                       "D", 0, NULL },
     450    { 'e', "encryption",   "Set encryption mode [required, preferred, tolerated]", "e", 1, "<mode>" },
     451    { 'f', "finish",       "Set a script to run when the torrent finishes",        "f", 1, "<script>" },
     452    { 'g', "config-dir",   "Where to look for configuration files",                "g", 1, "<path>" },
     453    { 'i', "info",         "Show torrent details and exit",                        "i", 0, NULL },
     454    { 'm', "portmap",      "Enable portmapping via NAT-PMP or UPnP",               "m", 0, NULL },
     455    { 'M', "no-portmap",   "Disable portmapping",                                  "M", 0, NULL },
     456    { 'n', "new",          "Create a new torrent from a file or directory",        "n", 1, "<path>" },
    452457    { 'p', "port",         "Port to listen for incoming peers (Default: "TR_DEFAULT_PORT_STR")", "p", 1, "<port>" },
    453     { 'r', "private",      "When creating a new torrent, set its 'private' flag", "r", 0, NULL },
    454     { 's', "scrape",       "Scrape the torrent and exit",                         "s", 0, NULL },
     458    { 'r', "private",      "When creating a new torrent, set its 'private' flag",  "r", 0, NULL },
     459    { 's', "scrape",       "Scrape the torrent and exit",                          "s", 0, NULL },
    455460    { 't', "tos",          "Peer socket TOS (0 to 255, default="TR_DEFAULT_PEER_SOCKET_TOS_STR")", "t", 1, "<number>"},
    456     { 'u', "uplimit",      "Set the maxiumum upload speed in KB/s",               "u", 1, "<number>" },
    457     { 'U', "no-uplimit",   "Don't limit the upload speed",                        "U", 0, NULL },
    458     { 'v', "verify",       "Verify the specified torrent",                        "v", 0, NULL },
    459     { 'w', "download-dir", "Where to save downloaded data",                       "w", 1, "<path>" },
     461    { 'u', "uplimit",      "Set the maxiumum upload speed in KB/s",                "u", 1, "<number>" },
     462    { 'U', "no-uplimit",   "Don't limit the upload speed",                         "U", 0, NULL },
     463    { 'v', "verify",       "Verify the specified torrent",                         "v", 0, NULL },
     464    { 'w', "download-dir", "Where to save downloaded data",                        "w", 1, "<path>" },
    460465    { 0, NULL, NULL, NULL, 0, NULL }
    461466};
     
    491496        {
    492497            case 'a': announce = optarg; break;
     498            case 'b': blocklistEnabled = 1; break;
     499            case 'B': blocklistEnabled = 0; break;
    493500            case 'c': comment = optarg; break;
    494501            case 'd': downloadLimit = numarg( optarg ); break;
    495502            case 'D': downloadLimit = -1; break;
     503            case 'e': if( !strcmp( optarg, "required" ) )
     504                          encryptionMode = TR_ENCRYPTION_REQUIRED;
     505                      else if( !strcmp( optarg, "tolerated" ) )
     506                          encryptionMode = TR_PLAINTEXT_PREFERRED;
     507                      else
     508                          encryptionMode = TR_ENCRYPTION_PREFERRED;
     509                      break;
    496510            case 'f': finishCall = optarg; break;
    497511            case 'g': configdir = optarg; break;
Note: See TracChangeset for help on using the changeset viewer.