Changeset 10782


Ignore:
Timestamp:
Jun 16, 2010, 2:05:18 PM (12 years ago)
Author:
charles
Message:

(trunk) #3263 "cli-based utils' --help page should limit themselves to 80 columns"

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/daemon.c

    r10659 r10782  
    6969    { 'b', "blocklist", "Enable peer blocklists", "b", 0, NULL },
    7070    { 'B', "no-blocklist", "Disable peer blocklists", "B", 0, NULL },
    71     { 'c', "watch-dir", "Directory to watch for new .torrent files", "c", 1, "<directory>" },
     71    { 'c', "watch-dir", "Where to watch for new .torrent files", "c", 1, "<directory>" },
    7272    { 'C', "no-watch-dir", "Disable the watch-dir", "C", 0, NULL },
    7373    { 941, "incomplete-dir", "Where to store new torrents until they're complete", NULL, 1, "<directory>" },
     
    9797    { 911, "encryption-preferred", "Prefer encrypted peer connections", "ep", 0, NULL },
    9898    { 912, "encryption-tolerated", "Prefer unencrypted peer connections", "et", 0, NULL },
    99     { 'i', "bind-address-ipv4", "Where to listen for peer connections", "i", 1, "<ipv4 address>" },
    100     { 'I', "bind-address-ipv6", "Where to listen for peer connections", "I", 1, "<ipv6 address>" },
    101     { 'r', "rpc-bind-address", "Where to listen for RPC connections", "r", 1, "<ipv4 address>" },
     99    { 'i', "bind-address-ipv4", "Where to listen for peer connections", "i", 1, "<ipv4 addr>" },
     100    { 'I', "bind-address-ipv6", "Where to listen for peer connections", "I", 1, "<ipv6 addr>" },
     101    { 'r', "rpc-bind-address", "Where to listen for RPC connections", "r", 1, "<ipv4 addr>" },
    102102    { 953, "global-seedratio", "All torrents, unless overridden by a per-torrent setting, should seed until a specific ratio", "gsr", 1, "ratio" },
    103103    { 954, "no-global-seedratio", "All torrents, unless overridden by a per-torrent setting, should seed regardless of ratio", "GSR", 0, NULL },
  • trunk/daemon/remote.c

    r10719 r10782  
    222222    { 'm', "portmap",                "Enable portmapping via NAT-PMP or UPnP", "m",  0, NULL },
    223223    { 'M', "no-portmap",             "Disable portmapping", "M",  0, NULL },
    224     { 'n', "auth",                   "Set authentication info", "n",  1, "<user:pass>" },
    225     { 'N', "netrc",                  "Set authentication info from a .netrc file", "N",  1, "<filename>" },
     224    { 'n', "auth",                   "Set username and password", "n",  1, "<user:pw>" },
     225    { 'N', "netrc",                  "Set authentication info from a .netrc file", "N",  1, "<file>" },
    226226    { 'o', "dht",                    "Enable distributed hash tables (DHT)", "o", 0, NULL },
    227227    { 'O', "no-dht",                 "Disable distributed hash tables (DHT)", "O", 0, NULL },
     
    229229    { 962, "port-test",              "Port testing", "pt", 0, NULL },
    230230    { 'P', "random-port",            "Random port for incomping peers", "P", 0, NULL },
    231     { 900, "priority-high",          "Try to download the specified file(s) first", "ph", 1, "<files>" },
    232     { 901, "priority-normal",        "Try to download the specified file(s) normally", "pn", 1, "<files>" },
    233     { 902, "priority-low",           "Try to download the specified file(s) last", "pl", 1, "<files>" },
     231    { 900, "priority-high",          "Try to download these file(s) first", "ph", 1, "<files>" },
     232    { 901, "priority-normal",        "Try to download these file(s) normally", "pn", 1, "<files>" },
     233    { 902, "priority-low",           "Try to download these file(s) last", "pl", 1, "<files>" },
    234234    { 700, "bandwidth-high",         "Give this torrent first chance at available bandwidth", "Bh", 0, NULL },
    235     { 701, "bandwidth-normal",       "Give this torrent the bandwidth left over by high priority torrents", "Bn", 0, NULL },
    236     { 702, "bandwidth-low",          "Give this torrent the bandwidth left over by high and normal priority torrents", "Bl", 0, NULL },
     235    { 701, "bandwidth-normal",       "Give this torrent bandwidth left over by high priority torrents", "Bn", 0, NULL },
     236    { 702, "bandwidth-low",          "Give this torrent bandwidth left over by high and normal priority torrents", "Bl", 0, NULL },
    237237    { 'r', "remove",                 "Remove the current torrent(s)", "r",  0, NULL },
    238238    { 930, "peers",                  "Set the maximum number of peers for the current torrent(s) or globally", "pr", 1, "<max>" },
    239239    { 'R', "remove-and-delete",      "Remove the current torrent(s) and delete local data", NULL, 0, NULL },
    240     { 800, "torrent-done-script",    "Specify a script to run when a torrent finishes", NULL, 1, "<filename>" },
    241     { 801, "no-torrent-done-script", "Don't run a script when torrnets finish", NULL, 0, NULL },
     240    { 800, "torrent-done-script",    "Specify a script to run when a torrent finishes", NULL, 1, "<file>" },
     241    { 801, "no-torrent-done-script", "Don't run a script when torrents finish", NULL, 0, NULL },
    242242    { 950, "seedratio",              "Let the current torrent(s) seed until a specific ratio", "sr", 1, "ratio" },
    243243    { 951, "seedratio-default",      "Let the current torrent(s) use the global seedratio settings", "srd", 0, NULL },
  • trunk/libtransmission/tr-getopt.c

    r9868 r10782  
    1111 */
    1212
     13#include <ctype.h> /* isspace() */
    1314#include <stdio.h>
    1415#include <stdlib.h> /* exit() */
     
    3839}
    3940
     41static int
     42get_next_line_len( const char * description, int maxlen )
     43{
     44    int end;
     45    int len = strlen( description );
     46
     47    if( len < maxlen )
     48        return len;
     49
     50    end = maxlen < len ? maxlen : len;
     51    while( ( end > 0 ) && !isspace( description[end] ) )
     52        --end;
     53
     54    return end ? end : len;
     55}
     56
    4057static void
    4158getopts_usage_line( const tr_option * opt,
     
    4461                    int               argWidth )
    4562{
     63    int len;
    4664    const char * longName   = opt->longName ? opt->longName : "";
    4765    const char * shortName  = opt->shortName ? opt->shortName : "";
    4866    const char * arg        = getArgName( opt );
    4967
    50     printf( "  %s%-*s %s%-*s %-*s  %s\n",
     68    const int d_indent = shortWidth + longWidth + argWidth + 7;
     69    const int d_width = 80 - d_indent;
     70    const char * d = opt->description;
     71
     72    printf( " %s%-*s %s%-*s %-*s ",
    5173            (shortName && *shortName ? "-" : " "), shortWidth, shortName,
    5274            (longName && *longName ? "--" : "  "), longWidth, longName,
    53             argWidth, arg,
    54             opt->description );
     75            argWidth, arg );
     76    len = get_next_line_len( d, d_width );
     77    printf( "%*.*s\n", len, len, d );
     78
     79    d += len;
     80    while( isspace( *d ) ) ++d;
     81
     82    while(( len = get_next_line_len( d, d_width ))) {
     83        printf( "%*.*s%*.*s\n", d_indent, d_indent, "", len, len, d );
     84        d += len;
     85        while( isspace( *d ) ) ++d;
     86    }
    5587}
    5688
Note: See TracChangeset for help on using the changeset viewer.