Changeset 3973


Ignore:
Timestamp:
Nov 26, 2007, 4:22:36 PM (14 years ago)
Author:
charles
Message:

apply tiennou's "output directory" patch from ticket #502

Location:
trunk/cli
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/cli/transmissioncli.1

    r3926 r3973  
    3838.Op Fl u Ar upload-rate
    3939.Op Fl f Ar script
     40.Op Fl o Ar output-dir
    4041.Op Fl n
    4142.Ar torrent-file
     
    5657The options are as follows:
    5758.Bl -tag -width Ds
    58 .lt Fl c, Fl -create-from Ar source-file
     59.It Fl c, Fl -create-from Ar source-file
    5960Create torrent from the specified source file.
    60 .lt Fl a, Fl -announce Ar announce-url
    61 Specifies the Announceurl the new torrent will use. Can only be
     61.It Fl a, Fl -announce Ar announce-url
     62Specifies the announce-url the new torrent will use. Can only be
    6263used in conjunction with -c or --create-from.
    63 .lt Fl r, Fl -private
     64.It Fl r, Fl -private
    6465Sets the private flag for the new torrent. Can only be used in
    6566conjunction with -c or --create-from.
    66 .lt Fl m, Fl -comment Ar comment-text
     67.It Fl m, Fl -comment Ar comment-text
    6768This optional parameter adds a comment to the new torrent. Can only
    6869be used in conjunction with -c or --create-from.
     
    7374cryptographic hash, the tracker, announcement, file size and file
    7475name.
     76.It Fl o, Fl -output-dir Ar directory
     77Uses the specified directory as destination for downloaded data.
    7578.It Fl s, -scrape
    7679Prints the number of seeders and leechers for the specified torrent
     
    9699In addition to these options, sending
    97100.Nm
    98 a SIGHUP signal can ask the tracker for more peers.
     101a SIGHUP signal will contact the tracker for more peers.
    99102.El
    100103.Sh FILES
  • trunk/cli/transmissioncli.c

    r3810 r3973  
    4242
    4343const char * USAGE =
    44 "Usage: %s [options] file.torrent [options]\n\n"
     44"Usage: %s [-car[-m]] [-dfinpsuv] [-h] file.torrent [output-dir]\n\n"
    4545"Options:\n"
    4646"  -c, --create-from <file>  Create torrent from the specified source file.\n"
     
    6666static int           uploadLimit   = 20;
    6767static int           downloadLimit = -1;
    68 static char          * torrentPath = NULL;
     68static char        * torrentPath   = NULL;
     69static char        * savePath      = ".";
    6970static int           natTraversal  = 0;
    7071static sig_atomic_t  gotsig        = 0;
     
    162163
    163164    /* Open and parse torrent file */
    164     if( !( tor = tr_torrentInit( h, torrentPath, ".", 0, &error ) ) )
     165    if( !( tor = tr_torrentInit( h, torrentPath, savePath, 0, &error ) ) )
    165166    {
    166167        printf( "Failed opening torrent file `%s'\n", torrentPath );
     
    351352    {
    352353        static struct option long_options[] =
    353           { { "help",     no_argument,       NULL, 'h' },
    354             { "info",     no_argument,       NULL, 'i' },
    355             { "scrape",   no_argument,       NULL, 's' },
    356             { "private",  no_argument,       NULL, 'r' },
    357             { "verbose",  required_argument, NULL, 'v' },
    358             { "port",     required_argument, NULL, 'p' },
    359             { "upload",   required_argument, NULL, 'u' },
    360             { "download", required_argument, NULL, 'd' },
    361             { "finish",   required_argument, NULL, 'f' },
    362             { "create",   required_argument, NULL, 'c' },
    363             { "comment",  required_argument, NULL, 'm' },
    364             { "announce", required_argument, NULL, 'a' },
    365             { "nat-traversal", no_argument,  NULL, 'n' },
     354          { { "help",     no_argument,          NULL, 'h' },
     355            { "info",     no_argument,          NULL, 'i' },
     356            { "scrape",   no_argument,          NULL, 's' },
     357            { "private",  no_argument,          NULL, 'r' },
     358            { "verbose",  required_argument,    NULL, 'v' },
     359            { "port",     required_argument,    NULL, 'p' },
     360            { "upload",   required_argument,    NULL, 'u' },
     361            { "download", required_argument,    NULL, 'd' },
     362            { "finish",   required_argument,    NULL, 'f' },
     363            { "create",   required_argument,    NULL, 'c' },
     364            { "comment",  required_argument,    NULL, 'm' },
     365            { "announce", required_argument,    NULL, 'a' },
     366            { "nat-traversal", no_argument,     NULL, 'n' },
     367            { "output-dir", required_argument,  NULL, 'o' },
    366368            { 0, 0, 0, 0} };
    367369
    368370        int c, optind = 0;
    369         c = getopt_long( argc, argv, "hisrv:p:u:d:f:c:m:a:n",
     371        c = getopt_long( argc, argv, "hisrv:p:u:d:f:c:m:a:n:o",
    370372                         long_options, &optind );
    371373        if( c < 0 )
     
    414416                natTraversal = 1;
    415417                break;
     418            case 'o':
     419                savePath = optarg;
    416420            default:
    417421                return 1;
     
    419423    }
    420424
    421     if( optind > argc - 1 )
     425    if( optind >= argc )
    422426    {
    423427        return !showHelp;
Note: See TracChangeset for help on using the changeset viewer.