From b2fbe2c896a8588f09b8f0339e215c5fc2bb04a2 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 23 Nov 2010 13:59:03 +0000 Subject: [PATCH] 2010-11-23 Tatsuhiro Tsujikawa Made --continue, --daemon, --no-conf, --no-netrc and --show-files option take optional argument. * doc/aria2c.1.txt * src/OptionHandlerFactory.cc * src/usage_text.h --- ChangeLog | 8 ++++++++ doc/aria2c.1 | 14 +++++++------- doc/aria2c.1.html | 12 ++++++------ doc/aria2c.1.txt | 10 +++++----- src/OptionHandlerFactory.cc | 18 +++++++++--------- src/usage_text.h | 10 +++++----- 6 files changed, 40 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2ed743a0..ee15bc6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-11-23 Tatsuhiro Tsujikawa + + Made --continue, --daemon, --no-conf, --no-netrc and --show-files + option take optional argument. + * doc/aria2c.1.txt + * src/OptionHandlerFactory.cc + * src/usage_text.h + 2010-11-20 Tatsuhiro Tsujikawa Added BtSeederStateChoke::PeerEntry::swap(). Also added diff --git a/doc/aria2c.1 b/doc/aria2c.1 index 0c31c2d1..a1736d7c 100644 --- a/doc/aria2c.1 +++ b/doc/aria2c.1 @@ -2,12 +2,12 @@ .\" Title: aria2c .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 10/31/2010 +.\" Date: 11/23/2010 .\" Manual: Aria2 Manual .\" Source: Aria2 1.10.6 .\" Language: English .\" -.TH "ARIA2C" "1" "10/31/2010" "Aria2 1\&.10\&.6" "Aria2 Manual" +.TH "ARIA2C" "1" "11/23/2010" "Aria2 1\&.10\&.6" "Aria2 Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -79,7 +79,7 @@ Check file integrity by validating piece hashes or a hash of entire file\&. This \fIfalse\fR .RE .PP -\fB\-c\fR, \fB\-\-continue\fR +\fB\-c\fR, \fB\-\-continue\fR[=\fItrue\fR|\fIfalse\fR] .RS 4 Continue downloading a partially downloaded file\&. Use this option to resume a download started by a web browser or another program which downloads files sequentially from the beginning\&. Currently this option is only applicable to HTTP(S)/FTP downloads\&. .RE @@ -209,7 +209,7 @@ Default: \fI20M\fR .RE .PP -\fB\-n\fR, \fB\-\-no\-netrc\fR +\fB\-n\fR, \fB\-\-no\-netrc\fR[=\fItrue\fR|\fIfalse\fR] .RS 4 Disables netrc support\&. netrc support is enabled by default\&. .RE @@ -636,7 +636,7 @@ In multi file torrent, the adjacent files specified by this option may also be d .sp .5v .RE .PP -\fB\-S\fR, \fB\-\-show\-files\fR +\fB\-S\fR, \fB\-\-show\-files\fR[=\fItrue\fR|\fIfalse\fR] .RS 4 Print file listing of \&.torrent or \&.metalink file and exit\&. In case of \&.torrent file, additional information (infohash, piece length, etc) is also printed\&. .RE @@ -1185,7 +1185,7 @@ Change the configuration file path to PATH\&. Default: \fI$HOME/\&.aria2/aria2\&.conf\fR .RE .PP -\fB\-D\fR, \fB\-\-daemon\fR +\fB\-D\fR, \fB\-\-daemon\fR[=\fItrue\fR|\fIfalse\fR] .RS 4 Run as daemon\&. The current working directory will be changed to \fI/\fR @@ -1428,7 +1428,7 @@ option\&. Default: \fI0\fR .RE .PP -\fB\-\-no\-conf\fR +\fB\-\-no\-conf\fR[=\fItrue\fR|\fIfalse\fR] .RS 4 Disable loading aria2\&.conf file\&. .RE diff --git a/doc/aria2c.1.html b/doc/aria2c.1.html index f1805ac9..d7f1dc77 100644 --- a/doc/aria2c.1.html +++ b/doc/aria2c.1.html @@ -661,7 +661,7 @@ downloading a file like BitTorrent.

--c, --continue +-c, --continue[=true|false]

@@ -820,7 +820,7 @@ then you get HTTP proxy "http://proxy" with user "user" and password

--n, --no-netrc +-n, --no-netrc[=true|false]

@@ -1344,7 +1344,7 @@ writes the piece to the appropriate files.

--S, --show-files +-S, --show-files[=true|false]

@@ -2042,7 +2042,7 @@ writes the piece to the appropriate files.

--D, --daemon +-D, --daemon[=true|false]

@@ -2306,7 +2306,7 @@ are also allocated if they share the same piece.

---no-conf +--no-conf[=true|false]

@@ -4708,7 +4708,7 @@ files in the program, then also delete it here.


diff --git a/doc/aria2c.1.txt b/doc/aria2c.1.txt index 3d54a8d6..6e9457f3 100644 --- a/doc/aria2c.1.txt +++ b/doc/aria2c.1.txt @@ -63,7 +63,7 @@ Basic Options hashes and a hash of entire file are provided, only piece hashes are used. Default: 'false' -[[aria2_optref_continue]]*-c*, *--continue*:: +[[aria2_optref_continue]]*-c*, *--continue*[='true'|'false']:: Continue downloading a partially downloaded file. Use this option to resume a download started by a web browser or another program which downloads files sequentially from the beginning. @@ -161,7 +161,7 @@ then you get HTTP proxy "http://proxy" with user "user" and password 1 source. You can append 'K' or 'M'(1K = 1024, 1M = 1024K). Possible Values: '1M'-'1024M' Default: '20M' -[[aria2_optref_no_netrc]]*-n*, *--no-netrc*:: +[[aria2_optref_no_netrc]]*-n*, *--no-netrc*[='true'|'false']:: Disables netrc support. netrc support is enabled by default. [[aria2_optref_no_proxy]]*--no-proxy*=DOMAINS:: @@ -441,7 +441,7 @@ also be downloaded. This is by design, not a bug. A single piece may include several files or part of files, and aria2 writes the piece to the appropriate files. -[[aria2_optref_show_files]]*-S*, *--show-files*:: +[[aria2_optref_show_files]]*-S*, *--show-files*[='true'|'false']:: Print file listing of .torrent or .metalink file and exit. In case of .torrent file, additional information (infohash, piece length, etc) is also printed. @@ -831,7 +831,7 @@ Advanced Options Change the configuration file path to PATH. Default: '$HOME/.aria2/aria2.conf' -[[aria2_optref_daemon]]*-D*, *--daemon*:: +[[aria2_optref_daemon]]*-D*, *--daemon*[='true'|'false']:: Run as daemon. The current working directory will be changed to '/' and standard input, standard output and standard error will be redirected to '/dev/null'. Default: 'false' @@ -990,7 +990,7 @@ are also allocated if they share the same piece. limit the overall download speed, use *<>* option. Default: '0' -[[aria2_optref_no_conf]]*--no-conf*:: +[[aria2_optref_no_conf]]*--no-conf*[='true'|'false']:: Disable loading aria2.conf file. [[aria2_optref_no_file_allocation_limit]]*--no-file-allocation-limit*=SIZE:: diff --git a/src/OptionHandlerFactory.cc b/src/OptionHandlerFactory.cc index 375a657b..d1120ad0 100644 --- a/src/OptionHandlerFactory.cc +++ b/src/OptionHandlerFactory.cc @@ -144,8 +144,8 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers() SharedHandle op(new BooleanOptionHandler (PREF_CONTINUE, TEXT_CONTINUE, - A2_V_FALSE, // TODO ommit? - OptionHandler::NO_ARG, + A2_V_FALSE, + OptionHandler::OPT_ARG, 'c')); op->addTag(TAG_BASIC); op->addTag(TAG_FTP); @@ -157,8 +157,8 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers() (PREF_DAEMON, TEXT_DAEMON, A2_V_FALSE, - OptionHandler::NO_ARG, - 'D')); // TODO ommit? + OptionHandler::OPT_ARG, + 'D')); op->addTag(TAG_ADVANCED); handlers.push_back(op); } @@ -416,7 +416,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers() (PREF_NO_CONF, TEXT_NO_CONF, A2_V_FALSE, - OptionHandler::NO_ARG)); + OptionHandler::OPT_ARG)); op->addTag(TAG_ADVANCED); handlers.push_back(op); } @@ -653,8 +653,8 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers() SharedHandle op(new BooleanOptionHandler (PREF_NO_NETRC, TEXT_NO_NETRC, - A2_V_FALSE, // TODO ommit? - OptionHandler::NO_ARG, + A2_V_FALSE, + OptionHandler::OPT_ARG, 'n')); op->addTag(TAG_FTP); op->addTag(TAG_HTTP); @@ -1138,8 +1138,8 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers() SharedHandle op(new BooleanOptionHandler (PREF_SHOW_FILES, TEXT_SHOW_FILES, - A2_V_FALSE, // TODO ommit? - OptionHandler::NO_ARG, + A2_V_FALSE, + OptionHandler::OPT_ARG, 'S')); op->addTag(TAG_BASIC); op->addTag(TAG_BITTORRENT); diff --git a/src/usage_text.h b/src/usage_text.h index eaa7acbb..a77f3d45 100644 --- a/src/usage_text.h +++ b/src/usage_text.h @@ -42,7 +42,7 @@ _(" -l, --log=LOG The file name of the log file. If '-' is\n" \ " specified, log is written to stdout.") #define TEXT_DAEMON \ - _(" -D, --daemon Run as daemon. The current working directory will\n" \ + _(" -D, --daemon[=true|false] Run as daemon. The current working directory will\n" \ " be changed to \"/\" and standard input, standard\n" \ " output and standard error will be redirected to\n" \ " \"/dev/null\".") @@ -199,7 +199,7 @@ " checksum while downloading a file if chunk\n" \ " checksums are provided.") #define TEXT_CONTINUE \ - _(" -c, --continue Continue downloading a partially downloaded\n" \ + _(" -c, --continue[=true|false] Continue downloading a partially downloaded\n" \ " file. Use this option to resume a download\n" \ " started by a web browser or another program\n" \ " which downloads files sequentially from the\n" \ @@ -208,7 +208,7 @@ #define TEXT_USER_AGENT \ _(" -U, --user-agent=USER_AGENT Set user agent for http(s) downloads.") #define TEXT_NO_NETRC \ - _(" -n, --no-netrc Disables netrc support.") + _(" -n, --no-netrc[=true|false] Disables netrc support.") #define TEXT_INPUT_FILE \ _(" -i, --input-file=FILE Downloads URIs found in FILE. You can specify\n" \ " multiple URIs for a single entity: separate\n" \ @@ -231,7 +231,7 @@ " overwritten. Session Cookies are also saved and\n" \ " their expiry values are treated as 0.") #define TEXT_SHOW_FILES \ - _(" -S, --show-files Print file listing of .torrent or .metalink file\n" \ + _(" -S, --show-files[=true|false] Print file listing of .torrent or .metalink file\n" \ " and exit. More detailed information will be listed\n" \ " in case of torrent file.") #define TEXT_SELECT_FILE \ @@ -388,7 +388,7 @@ " \"#http\". If non-tag word is given, print the usage\n" \ " for the options whose name includes that word.") #define TEXT_NO_CONF \ - _(" --no-conf Disable loading aria2.conf file.") + _(" --no-conf[=true|false] Disable loading aria2.conf file.") #define TEXT_CONF_PATH \ _(" --conf-path=PATH Change the configuration file path to PATH.") #define TEXT_STOP \