diff options
Diffstat (limited to 'networking/ftpgetput.c')
-rw-r--r-- | networking/ftpgetput.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c index cb0a96b59..029587aa2 100644 --- a/networking/ftpgetput.c +++ b/networking/ftpgetput.c | |||
@@ -39,37 +39,20 @@ | |||
39 | //usage: "[OPTIONS] HOST [LOCAL_FILE] REMOTE_FILE" | 39 | //usage: "[OPTIONS] HOST [LOCAL_FILE] REMOTE_FILE" |
40 | //usage:#define ftpget_full_usage "\n\n" | 40 | //usage:#define ftpget_full_usage "\n\n" |
41 | //usage: "Download a file via FTP\n" | 41 | //usage: "Download a file via FTP\n" |
42 | //usage: IF_FEATURE_FTPGETPUT_LONG_OPTIONS( | ||
43 | //usage: "\n -c,--continue Continue previous transfer" | ||
44 | //usage: "\n -v,--verbose Verbose" | ||
45 | //usage: "\n -u,--username USER Username" | ||
46 | //usage: "\n -p,--password PASS Password" | ||
47 | //usage: "\n -P,--port NUM Port" | ||
48 | //usage: ) | ||
49 | //usage: IF_NOT_FEATURE_FTPGETPUT_LONG_OPTIONS( | ||
50 | //usage: "\n -c Continue previous transfer" | 42 | //usage: "\n -c Continue previous transfer" |
51 | //usage: "\n -v Verbose" | 43 | //usage: "\n -v Verbose" |
52 | //usage: "\n -u USER Username" | 44 | //usage: "\n -u USER Username" |
53 | //usage: "\n -p PASS Password" | 45 | //usage: "\n -p PASS Password" |
54 | //usage: "\n -P NUM Port" | 46 | //usage: "\n -P NUM Port" |
55 | //usage: ) | ||
56 | //usage: | 47 | //usage: |
57 | //usage:#define ftpput_trivial_usage | 48 | //usage:#define ftpput_trivial_usage |
58 | //usage: "[OPTIONS] HOST [REMOTE_FILE] LOCAL_FILE" | 49 | //usage: "[OPTIONS] HOST [REMOTE_FILE] LOCAL_FILE" |
59 | //usage:#define ftpput_full_usage "\n\n" | 50 | //usage:#define ftpput_full_usage "\n\n" |
60 | //usage: "Upload a file to a FTP server\n" | 51 | //usage: "Upload a file to a FTP server\n" |
61 | //usage: IF_FEATURE_FTPGETPUT_LONG_OPTIONS( | ||
62 | //usage: "\n -v,--verbose Verbose" | ||
63 | //usage: "\n -u,--username USER Username" | ||
64 | //usage: "\n -p,--password PASS Password" | ||
65 | //usage: "\n -P,--port NUM Port" | ||
66 | //usage: ) | ||
67 | //usage: IF_NOT_FEATURE_FTPGETPUT_LONG_OPTIONS( | ||
68 | //usage: "\n -v Verbose" | 52 | //usage: "\n -v Verbose" |
69 | //usage: "\n -u USER Username" | 53 | //usage: "\n -u USER Username" |
70 | //usage: "\n -p PASS Password" | 54 | //usage: "\n -p PASS Password" |
71 | //usage: "\n -P NUM Port number" | 55 | //usage: "\n -P NUM Port number" |
72 | //usage: ) | ||
73 | 56 | ||
74 | #include "libbb.h" | 57 | #include "libbb.h" |
75 | #include "common_bufsiz.h" | 58 | #include "common_bufsiz.h" |
@@ -367,12 +350,15 @@ int ftpgetput_main(int argc UNUSED_PARAM, char **argv) | |||
367 | /* | 350 | /* |
368 | * Decipher the command line | 351 | * Decipher the command line |
369 | */ | 352 | */ |
353 | /* must have 2 to 3 params; -v and -c count */ | ||
354 | #define OPTSTRING "^cvu:p:P:" "\0" "-2:?3:vv:cc" | ||
370 | #if ENABLE_FEATURE_FTPGETPUT_LONG_OPTIONS | 355 | #if ENABLE_FEATURE_FTPGETPUT_LONG_OPTIONS |
371 | applet_long_options = ftpgetput_longopts; | 356 | getopt32long(argv, OPTSTRING, ftpgetput_longopts, |
357 | #else | ||
358 | getopt32(argv, OPTSTRING, | ||
372 | #endif | 359 | #endif |
373 | opt_complementary = "-2:vv:cc"; /* must have 2 to 3 params; -v and -c count */ | 360 | &user, &password, &port, &verbose_flag, &do_continue |
374 | getopt32(argv, "cvu:p:P:", &user, &password, &port, | 361 | ); |
375 | &verbose_flag, &do_continue); | ||
376 | argv += optind; | 362 | argv += optind; |
377 | 363 | ||
378 | /* We want to do exactly _one_ DNS lookup, since some | 364 | /* We want to do exactly _one_ DNS lookup, since some |