diff options
author | Vladimir Dronnikov <dronnikov@gmail.com> | 2009-10-23 23:34:43 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-23 23:34:43 +0200 |
commit | 1dacfbb1f466a2964cbf49855f336bcc1d25ebc0 (patch) | |
tree | c0fd2cd5645e19cef4e1d9945a4fe70189ade51a | |
parent | 337a31b0741f5e9ba32bedd750ab99bb253085dc (diff) | |
download | busybox-w32-1dacfbb1f466a2964cbf49855f336bcc1d25ebc0.tar.gz busybox-w32-1dacfbb1f466a2964cbf49855f336bcc1d25ebc0.tar.bz2 busybox-w32-1dacfbb1f466a2964cbf49855f336bcc1d25ebc0.zip |
ftpget/put: make 3rd parameter optional
function old new delta
packed_usage 26728 26738 +10
ftpgetput_main 343 351 +8
Signed-off-by: Vladimir Dronnikov <dronnikov@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | include/usage.h | 4 | ||||
-rw-r--r-- | networking/ftpgetput.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/include/usage.h b/include/usage.h index 8db1946cd..d03ec2295 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -1362,7 +1362,7 @@ | |||
1362 | "\n DIR Change root to this directory" \ | 1362 | "\n DIR Change root to this directory" \ |
1363 | 1363 | ||
1364 | #define ftpget_trivial_usage \ | 1364 | #define ftpget_trivial_usage \ |
1365 | "[OPTIONS] HOST LOCAL_FILE REMOTE_FILE" | 1365 | "[OPTIONS] HOST [LOCAL_FILE] REMOTE_FILE" |
1366 | #define ftpget_full_usage "\n\n" \ | 1366 | #define ftpget_full_usage "\n\n" \ |
1367 | "Retrieve a remote file via FTP\n" \ | 1367 | "Retrieve a remote file via FTP\n" \ |
1368 | "\nOptions:" \ | 1368 | "\nOptions:" \ |
@@ -1382,7 +1382,7 @@ | |||
1382 | ) | 1382 | ) |
1383 | 1383 | ||
1384 | #define ftpput_trivial_usage \ | 1384 | #define ftpput_trivial_usage \ |
1385 | "[OPTIONS] HOST REMOTE_FILE LOCAL_FILE" | 1385 | "[OPTIONS] HOST [REMOTE_FILE] LOCAL_FILE" |
1386 | #define ftpput_full_usage "\n\n" \ | 1386 | #define ftpput_full_usage "\n\n" \ |
1387 | "Store a local file on a remote machine via FTP\n" \ | 1387 | "Store a local file on a remote machine via FTP\n" \ |
1388 | "\nOptions:" \ | 1388 | "\nOptions:" \ |
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c index d39b73ebb..c0ecddac1 100644 --- a/networking/ftpgetput.c +++ b/networking/ftpgetput.c | |||
@@ -306,7 +306,7 @@ int ftpgetput_main(int argc UNUSED_PARAM, char **argv) | |||
306 | #if ENABLE_FEATURE_FTPGETPUT_LONG_OPTIONS | 306 | #if ENABLE_FEATURE_FTPGETPUT_LONG_OPTIONS |
307 | applet_long_options = ftpgetput_longopts; | 307 | applet_long_options = ftpgetput_longopts; |
308 | #endif | 308 | #endif |
309 | opt_complementary = "=3:vv:cc"; /* must have 3 params; -v and -c count */ | 309 | opt_complementary = "-2:vv:cc"; /* must have 2 to 3 params; -v and -c count */ |
310 | opt = getopt32(argv, "cvu:p:P:", &user, &password, &port, | 310 | opt = getopt32(argv, "cvu:p:P:", &user, &password, &port, |
311 | &verbose_flag, &do_continue); | 311 | &verbose_flag, &do_continue); |
312 | argv += optind; | 312 | argv += optind; |
@@ -321,5 +321,5 @@ int ftpgetput_main(int argc UNUSED_PARAM, char **argv) | |||
321 | } | 321 | } |
322 | 322 | ||
323 | ftp_login(); | 323 | ftp_login(); |
324 | return ftp_action(argv[1], argv[2]); | 324 | return ftp_action(argv[1], argv[2] ? argv[2] : argv[1]); |
325 | } | 325 | } |