From 688b9f860a449ee526816e3fc1636fb8c87e01a9 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 8 Jul 2008 18:12:36 +0000 Subject: [PATCH] steal some blocklist/encryption options from remote & reuse them in cli --- cli/transmissioncli.1 | 36 +++++++++++---------- cli/transmissioncli.c | 74 +++++++++++++++++++++++++------------------ 2 files changed, 64 insertions(+), 46 deletions(-) diff --git a/cli/transmissioncli.1 b/cli/transmissioncli.1 index 159127be2..632987bb4 100644 --- a/cli/transmissioncli.1 +++ b/cli/transmissioncli.1 @@ -24,28 +24,20 @@ .Bk -words .Fl h .Nm -.Op Fl v Ar level .Fl i .Ar torrent-file .Nm -.Op Fl v Ar level .Fl s .Ar torrent-file .Nm -.Op Fl v Ar level -.Op Fl p Ar port -.Op Fl d Ar number -.Op Fl u Ar number -.Op Fl f Ar script -.Op Fl n -.Ar torrent-file -.Op Ar output-dir -.Nm -.Fl n Ar path +.Fl n Ar sourcefile .Op Fl a Ar url .Op Fl c Ar comment .Op Fl r -.Ar output-file +.Ar new-torrent-file +.Nm +.Op options +.Ar torrent-file .Ek .Sh DESCRIPTION The @@ -59,6 +51,13 @@ The options are as follows: .It Fl a, Fl -announce Ar announce-url When creating a new torrent, set its announce URL +.It Fl b Fl -blocklist +Enable peer blocklists. Transmission understands the bluetack blocklist file format. +New blocklists can be added by copying them into the config-dir's "blocklists" subdirectory. + +.It Fl B Fl -no-blocklist +Disble blocklists. + .It Fl c, Fl -comment Ar comment-text When creating a new torrent, set its comment field @@ -68,6 +67,13 @@ Set the maximum download speed in KB/s .It Fl D, -no-downlimit Don't limit the download speed +.It Fl e Fl -encryption Ar required +Require all peer connections to be encrypted. +.It Fl e Fl -encryption Ar preferred +Prefer encrypted peer connections. +.It Fl e Fl -encryption Ar tolerated +Prefer unencrypted peer connections. + .It Fl f, -finish Ar script Set a script to run when the torrent finishes @@ -86,7 +92,7 @@ Enable portmapping via NAT-PMP or UPnP .It Fl M, Fl -no-portmap Disable portmapping -.It Fl n, Fl -new Ar path +.It Fl n, Fl -new Ar sourcefile Create torrent from the specified file or directory .It Fl p, -port Ar port @@ -113,8 +119,6 @@ Verify the torrent's downloaded data. .It Fl w, Fl -download-dir Ar directory Where to save downloaded data. -ccc - .Sh SIGNALS In addition to these options, sending .Nm diff --git a/cli/transmissioncli.c b/cli/transmissioncli.c index 4d1d0e153..12db0f9ad 100644 --- a/cli/transmissioncli.c +++ b/cli/transmissioncli.c @@ -38,18 +38,20 @@ #define MY_NAME "transmission-cli" -static int showInfo = 0; -static int showScrape = 0; -static int isPrivate = 0; -static int verboseLevel = 0; -static int peerPort = TR_DEFAULT_PORT; -static int peerSocketTOS = TR_DEFAULT_PEER_SOCKET_TOS; -static int uploadLimit = 20; -static int downloadLimit = -1; -static int natTraversal = 0; -static int verify = 0; -static sig_atomic_t gotsig = 0; -static sig_atomic_t manualUpdate = 0; +static int showInfo = 0; +static int showScrape = 0; +static int isPrivate = 0; +static int verboseLevel = 0; +static int encryptionMode = TR_ENCRYPTION_PREFERRED; +static int peerPort = TR_DEFAULT_PORT; +static int peerSocketTOS = TR_DEFAULT_PEER_SOCKET_TOS; +static int blocklistEnabled = TR_DEFAULT_BLOCKLIST_ENABLED; +static int uploadLimit = 20; +static int downloadLimit = -1; +static int natTraversal = TR_DEFAULT_PORT_FORWARDING_ENABLED; +static int verify = 0; +static sig_atomic_t gotsig = 0; +static sig_atomic_t manualUpdate = 0; static const char * torrentPath = NULL; static const char * downloadDir = NULL; @@ -187,7 +189,7 @@ main( int argc, char ** argv ) TR_DEFAULT_PEX_ENABLED, natTraversal, /* nat enabled */ peerPort, - TR_ENCRYPTION_PREFERRED, + encryptionMode, uploadLimit >= 0, uploadLimit, downloadLimit >= 0, @@ -195,7 +197,7 @@ main( int argc, char ** argv ) TR_DEFAULT_GLOBAL_PEER_LIMIT, verboseLevel + 1, /* messageLevel */ 0, /* is message queueing enabled? */ - TR_DEFAULT_BLOCKLIST_ENABLED, + blocklistEnabled, peerSocketTOS, TR_DEFAULT_RPC_ENABLED, TR_DEFAULT_RPC_PORT, @@ -439,24 +441,27 @@ getUsage( void ) } const struct tr_option options[] = { - { 'a', "announce", "When creating a new torrent, set its announce URL", "a", 1, "" }, - { 'c', "comment", "When creating a new torrent, set its comment field", "c", 1, "" }, - { 'd', "downlimit", "Set the maxiumum download speed in KB/s", "d", 1, "" }, - { 'D', "no-downlimit", "Don't limit the download speed", "D", 0, NULL }, - { 'f', "finish", "Set a script to run when the torrent finishes", "f", 1, "