diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2015-10-20 21:51:52 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2015-10-20 21:51:52 +0200 |
commit | 92e1b0826d8490c31d48048ef4c517ec2943d706 (patch) | |
tree | 51117fa20a9ec0ae5d2298d42d4b0bcaeca98ece | |
parent | edcd5dcc9b075af9965c66b54e14f1cb87940c9b (diff) | |
download | busybox-w32-92e1b0826d8490c31d48048ef4c517ec2943d706.tar.gz busybox-w32-92e1b0826d8490c31d48048ef4c517ec2943d706.tar.bz2 busybox-w32-92e1b0826d8490c31d48048ef4c517ec2943d706.zip |
wget: make Bartosz's "wget --passive-ftp -nd -t 3" work
function old new delta
static.wget_longopts 166 234 +68
wget_main 2608 2610 +2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | networking/wget.c | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/networking/wget.c b/networking/wget.c index af9c53c22..7f27e4e7b 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -102,7 +102,8 @@ | |||
102 | //usage: "[-c|--continue] [-s|--spider] [-q|--quiet] [-O|--output-document FILE]\n" | 102 | //usage: "[-c|--continue] [-s|--spider] [-q|--quiet] [-O|--output-document FILE]\n" |
103 | //usage: " [--header 'header: value'] [-Y|--proxy on/off] [-P DIR]\n" | 103 | //usage: " [--header 'header: value'] [-Y|--proxy on/off] [-P DIR]\n" |
104 | /* Since we ignore these opts, we don't show them in --help */ | 104 | /* Since we ignore these opts, we don't show them in --help */ |
105 | /* //usage: " [--no-check-certificate] [--no-cache]" */ | 105 | /* //usage: " [--no-check-certificate] [--no-cache] [--passive-ftp] [-t TRIES]" */ |
106 | /* //usage: " [-nv] [-nc] [-nH] [-np]" */ | ||
106 | //usage: " [-U|--user-agent AGENT]" IF_FEATURE_WGET_TIMEOUT(" [-T SEC]") " URL..." | 107 | //usage: " [-U|--user-agent AGENT]" IF_FEATURE_WGET_TIMEOUT(" [-T SEC]") " URL..." |
107 | //usage: ) | 108 | //usage: ) |
108 | //usage: IF_NOT_FEATURE_WGET_LONG_OPTIONS( | 109 | //usage: IF_NOT_FEATURE_WGET_LONG_OPTIONS( |
@@ -1219,19 +1220,22 @@ int wget_main(int argc UNUSED_PARAM, char **argv) | |||
1219 | "directory-prefix\0" Required_argument "P" | 1220 | "directory-prefix\0" Required_argument "P" |
1220 | "proxy\0" Required_argument "Y" | 1221 | "proxy\0" Required_argument "Y" |
1221 | "user-agent\0" Required_argument "U" | 1222 | "user-agent\0" Required_argument "U" |
1222 | #if ENABLE_FEATURE_WGET_TIMEOUT | 1223 | IF_FEATURE_WGET_TIMEOUT( |
1223 | "timeout\0" Required_argument "T" | 1224 | "timeout\0" Required_argument "T") |
1224 | #endif | ||
1225 | /* Ignored: */ | 1225 | /* Ignored: */ |
1226 | // "tries\0" Required_argument "t" | 1226 | IF_DESKTOP( "tries\0" Required_argument "t") |
1227 | "header\0" Required_argument "\xff" | ||
1228 | "post-data\0" Required_argument "\xfe" | ||
1227 | /* Ignored (we always use PASV): */ | 1229 | /* Ignored (we always use PASV): */ |
1228 | "passive-ftp\0" No_argument "\xff" | 1230 | IF_DESKTOP( "passive-ftp\0" No_argument "\xf0") |
1229 | "header\0" Required_argument "\xfe" | ||
1230 | "post-data\0" Required_argument "\xfd" | ||
1231 | /* Ignored (we don't do ssl) */ | 1231 | /* Ignored (we don't do ssl) */ |
1232 | "no-check-certificate\0" No_argument "\xfc" | 1232 | IF_DESKTOP( "no-check-certificate\0" No_argument "\xf0") |
1233 | /* Ignored (we don't support caching) */ | 1233 | /* Ignored (we don't support caching) */ |
1234 | "no-cache\0" No_argument "\xfb" | 1234 | IF_DESKTOP( "no-cache\0" No_argument "\xf0") |
1235 | IF_DESKTOP( "no-verbose\0" No_argument "\xf0") | ||
1236 | IF_DESKTOP( "no-clobber\0" No_argument "\xf0") | ||
1237 | IF_DESKTOP( "no-host-directories\0" No_argument "\xf0") | ||
1238 | IF_DESKTOP( "no-parent\0" No_argument "\xf0") | ||
1235 | ; | 1239 | ; |
1236 | #endif | 1240 | #endif |
1237 | 1241 | ||
@@ -1251,14 +1255,25 @@ int wget_main(int argc UNUSED_PARAM, char **argv) | |||
1251 | #if ENABLE_FEATURE_WGET_LONG_OPTIONS | 1255 | #if ENABLE_FEATURE_WGET_LONG_OPTIONS |
1252 | applet_long_options = wget_longopts; | 1256 | applet_long_options = wget_longopts; |
1253 | #endif | 1257 | #endif |
1254 | opt_complementary = "-1" | 1258 | opt_complementary = "-1" /* at least one URL */ |
1255 | IF_FEATURE_WGET_TIMEOUT(":T+") | 1259 | IF_FEATURE_WGET_TIMEOUT(":T+") /* -T NUM */ |
1256 | IF_FEATURE_WGET_LONG_OPTIONS(":\xfe::"); | 1260 | IF_FEATURE_WGET_LONG_OPTIONS(":\xff::"); /* --header is a list */ |
1257 | getopt32(argv, "csqO:P:Y:U:T:" /*ignored:*/ "t:", | 1261 | getopt32(argv, "csqO:P:Y:U:T:" |
1258 | &G.fname_out, &G.dir_prefix, | 1262 | /*ignored:*/ "t:" |
1263 | /*ignored:*/ "n::" | ||
1264 | /* wget has exactly four -n<letter> opts, all of which we can ignore: | ||
1265 | * -nv --no-verbose: be moderately quiet (-q is full quiet) | ||
1266 | * -nc --no-clobber: abort if exists, neither download to FILE.n nor overwrite FILE | ||
1267 | * -nH --no-host-directories: wget -r http://host/ won't create host/ | ||
1268 | * -np --no-parent | ||
1269 | * "n::" above says that we accept -n[ARG]. | ||
1270 | * Specifying "n:" would be a bug: "-n ARG" would eat ARG! | ||
1271 | */ | ||
1272 | , &G.fname_out, &G.dir_prefix, | ||
1259 | &G.proxy_flag, &G.user_agent, | 1273 | &G.proxy_flag, &G.user_agent, |
1260 | IF_FEATURE_WGET_TIMEOUT(&G.timeout_seconds) IF_NOT_FEATURE_WGET_TIMEOUT(NULL), | 1274 | IF_FEATURE_WGET_TIMEOUT(&G.timeout_seconds) IF_NOT_FEATURE_WGET_TIMEOUT(NULL), |
1261 | NULL /* -t RETRIES */ | 1275 | NULL, /* -t RETRIES */ |
1276 | NULL /* -n[ARG] */ | ||
1262 | IF_FEATURE_WGET_LONG_OPTIONS(, &headers_llist) | 1277 | IF_FEATURE_WGET_LONG_OPTIONS(, &headers_llist) |
1263 | IF_FEATURE_WGET_LONG_OPTIONS(, &G.post_data) | 1278 | IF_FEATURE_WGET_LONG_OPTIONS(, &G.post_data) |
1264 | ); | 1279 | ); |