浏览代码

2010-11-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

	Made --allow-overwrite, --allow-piece-length-change,
	--realtime-chunk-checksum and --bt-require-crypto take optional
	argument. Fixed usage doc for --metalink-enable-unique-protocol.
	* doc/aria2c.1.txt
	* src/OptionHandlerFactory.cc
	* src/usage_text.h
Tatsuhiro Tsujikawa 15 年之前
父节点
当前提交
b8055f259b
共有 6 个文件被更改,包括 41 次插入31 次删除
  1. 9 0
      ChangeLog
  2. 5 5
      doc/aria2c.1
  3. 6 6
      doc/aria2c.1.html
  4. 5 5
      doc/aria2c.1.txt
  5. 8 4
      src/OptionHandlerFactory.cc
  6. 8 11
      src/usage_text.h

+ 9 - 0
ChangeLog

@@ -1,3 +1,12 @@
+2010-11-23  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
+
+	Made --allow-overwrite, --allow-piece-length-change,
+	--realtime-chunk-checksum and --bt-require-crypto take optional
+	argument. Fixed usage doc for --metalink-enable-unique-protocol.
+	* doc/aria2c.1.txt
+	* src/OptionHandlerFactory.cc
+	* src/usage_text.h
+
 2010-11-23  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 2010-11-23  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 
 	Made --continue, --daemon, --no-conf, --no-netrc and --show-files
 	Made --continue, --daemon, --no-conf, --no-netrc and --show-files

+ 5 - 5
doc/aria2c.1

@@ -721,7 +721,7 @@ or
 \fIM\fR(1K = 1024, 1M = 1024K)\&. If SIZE is omitted, SIZE=1M is used\&.
 \fIM\fR(1K = 1024, 1M = 1024K)\&. If SIZE is omitted, SIZE=1M is used\&.
 .RE
 .RE
 .PP
 .PP
-\fB\-\-bt\-require\-crypto\fR=\fItrue\fR|\fIfalse\fR
+\fB\-\-bt\-require\-crypto\fR[=\fItrue\fR|\fIfalse\fR]
 .RS 4
 .RS 4
 If true is given, aria2 doesn\(cqt accept and establish connection with legacy BitTorrent handshake(\e19BitTorrent protocol)\&. Thus aria2 always uses Obfuscation handshake\&. Default:
 If true is given, aria2 doesn\(cqt accept and establish connection with legacy BitTorrent handshake(\e19BitTorrent protocol)\&. Thus aria2 always uses Obfuscation handshake\&. Default:
 \fIfalse\fR
 \fIfalse\fR
@@ -1061,7 +1061,7 @@ to disable this feature\&. Default:
 \fInone\fR
 \fInone\fR
 .RE
 .RE
 .PP
 .PP
-\fB\-\-metalink\-enable\-unique\-protocol\fR=\fItrue\fR|\fIfalse\fR
+\fB\-\-metalink\-enable\-unique\-protocol\fR[=\fItrue\fR|\fIfalse\fR]
 .RS 4
 .RS 4
 If
 If
 \fItrue\fR
 \fItrue\fR
@@ -1115,7 +1115,7 @@ Set XML\-RPC user\&.
 .RE
 .RE
 .SS "Advanced Options"
 .SS "Advanced Options"
 .PP
 .PP
-\fB\-\-allow\-overwrite\fR=\fItrue\fR|\fIfalse\fR
+\fB\-\-allow\-overwrite\fR[=\fItrue\fR|\fIfalse\fR]
 .RS 4
 .RS 4
 Restart download from scratch if the corresponding control file doesn\(cqt exist\&. See also
 Restart download from scratch if the corresponding control file doesn\(cqt exist\&. See also
 \fB\-\-auto\-file\-renaming\fR
 \fB\-\-auto\-file\-renaming\fR
@@ -1123,7 +1123,7 @@ option\&. Default:
 \fIfalse\fR
 \fIfalse\fR
 .RE
 .RE
 .PP
 .PP
-\fB\-\-allow\-piece\-length\-change\fR=\fItrue\fR|\fIfalse\fR
+\fB\-\-allow\-piece\-length\-change\fR[=\fItrue\fR|\fIfalse\fR]
 .RS 4
 .RS 4
 If false is given, aria2 aborts download when a piece length is different from one in a control file\&. If true is given, you can proceed but some download progress will be lost\&. Default:
 If false is given, aria2 aborts download when a piece length is different from one in a control file\&. If true is given, you can proceed but some download progress will be lost\&. Default:
 \fIfalse\fR
 \fIfalse\fR
@@ -1456,7 +1456,7 @@ Make aria2 quiet (no console output)\&. Default:
 \fIfalse\fR
 \fIfalse\fR
 .RE
 .RE
 .PP
 .PP
-\fB\-\-realtime\-chunk\-checksum\fR=\fItrue\fR|\fIfalse\fR
+\fB\-\-realtime\-chunk\-checksum\fR[=\fItrue\fR|\fIfalse\fR]
 .RS 4
 .RS 4
 Validate chunk of data by calculating checksum while downloading a file if chunk checksums are provided\&. Default:
 Validate chunk of data by calculating checksum while downloading a file if chunk checksums are provided\&. Default:
 \fItrue\fR
 \fItrue\fR

+ 6 - 6
doc/aria2c.1.html

@@ -1467,7 +1467,7 @@ writes the piece to the appropriate files.</td>
 </p>
 </p>
 </dd>
 </dd>
 <dt class="hdlist1">
 <dt class="hdlist1">
-<a id="aria2_optref_bt_require_crypto"></a><strong>--bt-require-crypto</strong>=<em>true</em>|<em>false</em>
+<a id="aria2_optref_bt_require_crypto"></a><strong>--bt-require-crypto</strong>[=<em>true</em>|<em>false</em>]
 </dt>
 </dt>
 <dd>
 <dd>
 <p>
 <p>
@@ -1880,7 +1880,7 @@ writes the piece to the appropriate files.</td>
 </p>
 </p>
 </dd>
 </dd>
 <dt class="hdlist1">
 <dt class="hdlist1">
-<a id="aria2_optref_metalink_enable_unique_protocol"></a><strong>--metalink-enable-unique-protocol</strong>=<em>true</em>|<em>false</em>
+<a id="aria2_optref_metalink_enable_unique_protocol"></a><strong>--metalink-enable-unique-protocol</strong>[=<em>true</em>|<em>false</em>]
 </dt>
 </dt>
 <dd>
 <dd>
 <p>
 <p>
@@ -1951,7 +1951,7 @@ writes the piece to the appropriate files.</td>
 <h3 id="_advanced_options">Advanced Options</h3><div style="clear:left"></div>
 <h3 id="_advanced_options">Advanced Options</h3><div style="clear:left"></div>
 <div class="dlist"><dl>
 <div class="dlist"><dl>
 <dt class="hdlist1">
 <dt class="hdlist1">
-<a id="aria2_optref_allow_overwrite"></a><strong>--allow-overwrite</strong>=<em>true</em>|<em>false</em>
+<a id="aria2_optref_allow_overwrite"></a><strong>--allow-overwrite</strong>[=<em>true</em>|<em>false</em>]
 </dt>
 </dt>
 <dd>
 <dd>
 <p>
 <p>
@@ -1961,7 +1961,7 @@ writes the piece to the appropriate files.</td>
 </p>
 </p>
 </dd>
 </dd>
 <dt class="hdlist1">
 <dt class="hdlist1">
-<a id="aria2_optref_allow_piece_length_change"></a><strong>--allow-piece-length-change</strong>=<em>true</em>|<em>false</em>
+<a id="aria2_optref_allow_piece_length_change"></a><strong>--allow-piece-length-change</strong>[=<em>true</em>|<em>false</em>]
 </dt>
 </dt>
 <dd>
 <dd>
 <p>
 <p>
@@ -2348,7 +2348,7 @@ are also allocated if they share the same piece.</td>
 </p>
 </p>
 </dd>
 </dd>
 <dt class="hdlist1">
 <dt class="hdlist1">
-<a id="aria2_optref_realtime_chunk_checksum"></a><strong>--realtime-chunk-checksum</strong>=<em>true</em>|<em>false</em>
+<a id="aria2_optref_realtime_chunk_checksum"></a><strong>--realtime-chunk-checksum</strong>[=<em>true</em>|<em>false</em>]
 </dt>
 </dt>
 <dd>
 <dd>
 <p>
 <p>
@@ -4708,7 +4708,7 @@ files in the program, then also delete it here.</p></div>
 <div id="footnotes"><hr /></div>
 <div id="footnotes"><hr /></div>
 <div id="footer">
 <div id="footer">
 <div id="footer-text">
 <div id="footer-text">
-Last updated 2010-11-23 22:54:53 JST
+Last updated 2010-11-23 23:06:32 JST
 </div>
 </div>
 </div>
 </div>
 </body>
 </body>

+ 5 - 5
doc/aria2c.1.txt

@@ -514,7 +514,7 @@ BitTorrent Specific Options
   last SIZE bytes of each file. SIZE can include 'K' or 'M'(1K = 1024,
   last SIZE bytes of each file. SIZE can include 'K' or 'M'(1K = 1024,
   1M = 1024K). If SIZE is omitted, SIZE=1M is used.
   1M = 1024K). If SIZE is omitted, SIZE=1M is used.
 
 
-[[aria2_optref_bt_require_crypto]]*--bt-require-crypto*='true'|'false'::
+[[aria2_optref_bt_require_crypto]]*--bt-require-crypto*[='true'|'false']::
   If true is given, aria2 doesn't accept and establish connection with legacy
   If true is given, aria2 doesn't accept and establish connection with legacy
   BitTorrent handshake(\19BitTorrent protocol).
   BitTorrent handshake(\19BitTorrent protocol).
   Thus aria2 always uses Obfuscation handshake.
   Thus aria2 always uses Obfuscation handshake.
@@ -740,7 +740,7 @@ Metalink Specific Options
   Specify 'none' to disable this feature.
   Specify 'none' to disable this feature.
   Default: 'none'
   Default: 'none'
  
  
-[[aria2_optref_metalink_enable_unique_protocol]]*--metalink-enable-unique-protocol*='true'|'false'::
+[[aria2_optref_metalink_enable_unique_protocol]]*--metalink-enable-unique-protocol*[='true'|'false']::
   If 'true' is given and several protocols are available for a mirror in a
   If 'true' is given and several protocols are available for a mirror in a
   metalink file, aria2 uses one of them.
   metalink file, aria2 uses one of them.
   Use *<<aria2_optref_metalink_preferred_protocol, --metalink-preferred-protocol>>* option to specify the preference of
   Use *<<aria2_optref_metalink_preferred_protocol, --metalink-preferred-protocol>>* option to specify the preference of
@@ -777,13 +777,13 @@ XML-RPC Options
 
 
 Advanced Options
 Advanced Options
 ~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~
-[[aria2_optref_allow_overwrite]]*--allow-overwrite*='true'|'false'::
+[[aria2_optref_allow_overwrite]]*--allow-overwrite*[='true'|'false']::
 
 
   Restart download from scratch if the corresponding control file
   Restart download from scratch if the corresponding control file
   doesn't exist.  See also *<<aria2_optref_auto_file_renaming, --auto-file-renaming>>* option.  Default:
   doesn't exist.  See also *<<aria2_optref_auto_file_renaming, --auto-file-renaming>>* option.  Default:
   'false'
   'false'
 
 
-[[aria2_optref_allow_piece_length_change]]*--allow-piece-length-change*='true'|'false'::
+[[aria2_optref_allow_piece_length_change]]*--allow-piece-length-change*[='true'|'false']::
   If false is given, aria2 aborts download when a piece length is different
   If false is given, aria2 aborts download when a piece length is different
   from one in a control file.
   from one in a control file.
   If true is given, you can proceed but some download progress will be lost.
   If true is given, you can proceed but some download progress will be lost.
@@ -1012,7 +1012,7 @@ are also allocated if they share the same piece.
   Make aria2 quiet (no console output).
   Make aria2 quiet (no console output).
   Default: 'false'
   Default: 'false'
 
 
-[[aria2_optref_realtime_chunk_checksum]]*--realtime-chunk-checksum*='true'|'false'::
+[[aria2_optref_realtime_chunk_checksum]]*--realtime-chunk-checksum*[='true'|'false']::
    Validate chunk of data by calculating checksum while downloading a file if
    Validate chunk of data by calculating checksum while downloading a file if
    chunk checksums are provided.
    chunk checksums are provided.
    Default: 'true'
    Default: 'true'

+ 8 - 4
src/OptionHandlerFactory.cc

@@ -53,7 +53,8 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
     SharedHandle<OptionHandler> op(new BooleanOptionHandler
     SharedHandle<OptionHandler> op(new BooleanOptionHandler
                                    (PREF_ALLOW_OVERWRITE,
                                    (PREF_ALLOW_OVERWRITE,
                                     TEXT_ALLOW_OVERWRITE,
                                     TEXT_ALLOW_OVERWRITE,
-                                    A2_V_FALSE));
+                                    A2_V_FALSE,
+                                    OptionHandler::OPT_ARG));
     op->addTag(TAG_ADVANCED);
     op->addTag(TAG_ADVANCED);
     op->addTag(TAG_FILE);
     op->addTag(TAG_FILE);
     handlers.push_back(op);
     handlers.push_back(op);
@@ -62,7 +63,8 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
     SharedHandle<OptionHandler> op(new BooleanOptionHandler
     SharedHandle<OptionHandler> op(new BooleanOptionHandler
                                    (PREF_ALLOW_PIECE_LENGTH_CHANGE,
                                    (PREF_ALLOW_PIECE_LENGTH_CHANGE,
                                     TEXT_ALLOW_PIECE_LENGTH_CHANGE,
                                     TEXT_ALLOW_PIECE_LENGTH_CHANGE,
-                                    A2_V_FALSE));
+                                    A2_V_FALSE,
+                                    OptionHandler::OPT_ARG));
     op->addTag(TAG_ADVANCED);
     op->addTag(TAG_ADVANCED);
     handlers.push_back(op);
     handlers.push_back(op);
   }
   }
@@ -505,7 +507,8 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
     SharedHandle<OptionHandler> op(new BooleanOptionHandler
     SharedHandle<OptionHandler> op(new BooleanOptionHandler
                                    (PREF_REALTIME_CHUNK_CHECKSUM,
                                    (PREF_REALTIME_CHUNK_CHECKSUM,
                                     TEXT_REALTIME_CHUNK_CHECKSUM,
                                     TEXT_REALTIME_CHUNK_CHECKSUM,
-                                    A2_V_TRUE));
+                                    A2_V_TRUE,
+                                    OptionHandler::OPT_ARG));
     op->addTag(TAG_METALINK);
     op->addTag(TAG_METALINK);
     handlers.push_back(op);
     handlers.push_back(op);
   }
   }
@@ -1262,7 +1265,8 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
     SharedHandle<OptionHandler> op(new BooleanOptionHandler
     SharedHandle<OptionHandler> op(new BooleanOptionHandler
                                    (PREF_BT_REQUIRE_CRYPTO,
                                    (PREF_BT_REQUIRE_CRYPTO,
                                     TEXT_BT_REQUIRE_CRYPTO,
                                     TEXT_BT_REQUIRE_CRYPTO,
-                                    A2_V_FALSE));
+                                    A2_V_FALSE,
+                                    OptionHandler::OPT_ARG));
     op->addTag(TAG_BITTORRENT);
     op->addTag(TAG_BITTORRENT);
     handlers.push_back(op);
     handlers.push_back(op);
   }
   }

+ 8 - 11
src/usage_text.h

@@ -147,14 +147,14 @@
     "                              allocating files.\n"                 \
     "                              allocating files.\n"                 \
     "                              Turn off if you encounter any error")
     "                              Turn off if you encounter any error")
 #define TEXT_ALLOW_OVERWRITE                                            \
 #define TEXT_ALLOW_OVERWRITE                                            \
-  _(" --allow-overwrite=true|false Restart download from scratch if the\n" \
+  _(" --allow-overwrite[=true|false] Restart download from scratch if the\n" \
     "                              corresponding control file doesn't exist.  See\n" \
     "                              corresponding control file doesn't exist.  See\n" \
     "                              also --auto-file-renaming option.")
     "                              also --auto-file-renaming option.")
 #define TEXT_ALLOW_PIECE_LENGTH_CHANGE                                  \
 #define TEXT_ALLOW_PIECE_LENGTH_CHANGE                                  \
-  _(" --allow-piece-length-change=true|false If false is given, aria2 aborts download\n" \
-    "                              when a piece length is different from one in\n" \
-    "                              a control file. If true is given, you can proceed\n" \
-    "                              but some download progress will be lost.")  
+  _(" --allow-piece-length-change[=true|false] If false is given, aria2 aborts\n" \
+    "                              download when a piece length is different from\n" \
+    "                              one in a control file. If true is given, you can\n" \
+    "                              proceed but some download progress will be lost.")  
 #define TEXT_FORCE_SEQUENTIAL                                           \
 #define TEXT_FORCE_SEQUENTIAL                                           \
   _(" -Z, --force-sequential[=true|false] Fetch URIs in the command-line sequentially\n" \
   _(" -Z, --force-sequential[=true|false] Fetch URIs in the command-line sequentially\n" \
     "                              and download each URI in a separate session, like\n" \
     "                              and download each URI in a separate session, like\n" \
@@ -195,7 +195,7 @@
     "                              This option has effect only on BitTorrent\n" \
     "                              This option has effect only on BitTorrent\n" \
     "                              download.")
     "                              download.")
 #define TEXT_REALTIME_CHUNK_CHECKSUM                                    \
 #define TEXT_REALTIME_CHUNK_CHECKSUM                                    \
-  _(" --realtime-chunk-checksum=true|false  Validate chunk of data by calculating\n" \
+  _(" --realtime-chunk-checksum[=true|false]  Validate chunk of data by calculating\n" \
     "                              checksum while downloading a file if chunk\n" \
     "                              checksum while downloading a file if chunk\n" \
     "                              checksums are provided.")
     "                              checksums are provided.")
 #define TEXT_CONTINUE                                                   \
 #define TEXT_CONTINUE                                                   \
@@ -255,9 +255,6 @@
     "                              written to the disk, but is just kept in memory.\n" \
     "                              written to the disk, but is just kept in memory.\n" \
     "                              If false is specified, the action mentioned above\n" \
     "                              If false is specified, the action mentioned above\n" \
     "                              is not taken.")
     "                              is not taken.")
-#define TEXT_DIRECT_FILE_MAPPING                                        \
-  _(" --direct-file-mapping=true|false Directly read from and write to each file\n" \
-    "                              mentioned in .torrent file.")
 #define TEXT_LISTEN_PORT                                                \
 #define TEXT_LISTEN_PORT                                                \
   _(" --listen-port=PORT...        Set TCP port number for BitTorrent downloads.\n" \
   _(" --listen-port=PORT...        Set TCP port number for BitTorrent downloads.\n" \
     "                              Multiple ports can be specified by using ',',\n" \
     "                              Multiple ports can be specified by using ',',\n" \
@@ -315,7 +312,7 @@
     "                              peer, aria2 chooses the lowest one which satisfies\n" \
     "                              peer, aria2 chooses the lowest one which satisfies\n" \
     "                              the given level.")
     "                              the given level.")
 #define TEXT_BT_REQUIRE_CRYPTO                                          \
 #define TEXT_BT_REQUIRE_CRYPTO                                          \
-  _(" --bt-require-crypto=true|false If true is given, aria2 doesn't accept and\n" \
+  _(" --bt-require-crypto[=true|false] If true is given, aria2 doesn't accept and\n" \
     "                              establish connection with legacy BitTorrent\n" \
     "                              establish connection with legacy BitTorrent\n" \
     "                              handshake. Thus aria2 always uses Obfuscation\n" \
     "                              handshake. Thus aria2 always uses Obfuscation\n" \
     "                              handshake.")
     "                              handshake.")
@@ -373,7 +370,7 @@
     "                              If false is specified, the action mentioned above\n" \
     "                              If false is specified, the action mentioned above\n" \
     "                              is not taken.")
     "                              is not taken.")
 #define TEXT_METALINK_ENABLE_UNIQUE_PROTOCOL                            \
 #define TEXT_METALINK_ENABLE_UNIQUE_PROTOCOL                            \
-  _(" --metalink-enable-unique-protocol=true|false If true is given and several\n" \
+  _(" --metalink-enable-unique-protocol[=true|false] If true is given and several\n" \
     "                              protocols are available for a mirror in a metalink\n" \
     "                              protocols are available for a mirror in a metalink\n" \
     "                              file, aria2 uses one of them.\n"     \
     "                              file, aria2 uses one of them.\n"     \
     "                              Use --metalink-preferred-protocol option to\n" \
     "                              Use --metalink-preferred-protocol option to\n" \