diff --git a/ChangeLog b/ChangeLog index e7e930ad..8511680e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2010-03-19 Tatsuhiro Tsujikawa + + Lines starting "#" in -i list are treated as comments. + Example: + # this is comment + http://example.org/file + http://example.org/file2 + dir=/tmp + # another comment + out=myfile + * doc/aria2c.1.txt + * src/UriListParser.cc + * test/filelist1.txt + 2010-03-19 Tatsuhiro Tsujikawa Accept IPv4 network address with CIDR block in --no-proxy option diff --git a/doc/aria2c.1 b/doc/aria2c.1 index 401d286d..bb7dd4c5 100644 --- a/doc/aria2c.1 +++ b/doc/aria2c.1 @@ -1426,6 +1426,8 @@ The input file can contain a list of URIs for aria2 to download\&. You can speci .sp Each line is treated as if it is provided in command\-line argument\&. Therefore they are affected by \fB\-Z\fR and \fB\-P\fR options\&. .sp +Lines starting with "#" are treated as comments and skipped\&. +.sp Additionally, the following options can be specified after each line of URIs\&. These optional lines must start with white space(s)\&. .sp .RS 4 diff --git a/doc/aria2c.1.html b/doc/aria2c.1.html index 657cd4f6..c001d9ce 100644 --- a/doc/aria2c.1.html +++ b/doc/aria2c.1.html @@ -2349,6 +2349,7 @@ can specify multiple URIs for a single entity: separate URIs on a single line using the TAB character.

Each line is treated as if it is provided in command-line argument. Therefore they are affected by -Z and -P options.

+

Lines starting with "#" are treated as comments and skipped.

Additionally, the following options can be specified after each line of URIs. These optional lines must start with white space(s).

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


diff --git a/doc/aria2c.1.txt b/doc/aria2c.1.txt index b8bda52c..ffb5b373 100644 --- a/doc/aria2c.1.txt +++ b/doc/aria2c.1.txt @@ -1047,6 +1047,8 @@ single line using the TAB character. Each line is treated as if it is provided in command-line argument. Therefore they are affected by *-Z* and *-P* options. +Lines starting with "#" are treated as comments and skipped. + Additionally, the following options can be specified after each line of URIs. These optional lines must start with white space(s). diff --git a/src/UriListParser.cc b/src/UriListParser.cc index 51618e0e..2ac5b96e 100644 --- a/src/UriListParser.cc +++ b/src/UriListParser.cc @@ -41,6 +41,7 @@ #include "Option.h" #include "OptionHandlerFactory.h" #include "OptionHandler.h" +#include "A2STR.h" namespace aria2 { @@ -57,6 +58,8 @@ void UriListParser::getOptions(Option& op) while(getline(_in, _line)) { if(util::startsWith(_line, " ")) { ss << _line << "\n"; + } else if(util::startsWith(_line, A2STR::SHARP_C)) { + continue; } else { break; } @@ -73,7 +76,7 @@ void UriListParser::parseNext(std::vector& uris, Option& op) return; } do { - if(!util::trim(_line).empty()) { + if(!util::startsWith(_line, A2STR::SHARP_C) && !util::trim(_line).empty()) { util::split(_line, std::back_inserter(uris), "\t", true); getOptions(op); return; diff --git a/test/filelist1.txt b/test/filelist1.txt index de63f272..1e459283 100644 --- a/test/filelist1.txt +++ b/test/filelist1.txt @@ -1,5 +1,7 @@ +# comment line http://localhost/index.html http://localhost2/index.html ftp://localhost/aria2.tar.bz2 dir=/tmp +# comment line out=chunky_chocolate