diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-03-08 03:01:10 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-03-08 03:01:10 +0100 |
commit | 115c35d68efa61f168c471df4627e4316952a69b (patch) | |
tree | d949887af5d0a8ae70340dd00207efde87a18e95 | |
parent | 9283d7c5c24cb5875f1115117fde2c69ff7735dc (diff) | |
download | busybox-w32-115c35d68efa61f168c471df4627e4316952a69b.tar.gz busybox-w32-115c35d68efa61f168c471df4627e4316952a69b.tar.bz2 busybox-w32-115c35d68efa61f168c471df4627e4316952a69b.zip |
ftpd: better usage text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | include/usage.src.h | 17 | ||||
-rw-r--r-- | networking/ftpd.c | 19 |
2 files changed, 18 insertions, 18 deletions
diff --git a/include/usage.src.h b/include/usage.src.h index df770c454..5a725e305 100644 --- a/include/usage.src.h +++ b/include/usage.src.h | |||
@@ -1273,23 +1273,6 @@ INSERT | |||
1273 | "\n -m Show \"mode not cleared\" warnings" \ | 1273 | "\n -m Show \"mode not cleared\" warnings" \ |
1274 | "\n -f Force file system check" \ | 1274 | "\n -f Force file system check" \ |
1275 | 1275 | ||
1276 | #define ftpd_trivial_usage \ | ||
1277 | "[-wvS] [-t N] [-T N] [DIR]" | ||
1278 | #define ftpd_full_usage "\n\n" \ | ||
1279 | "Anonymous FTP server\n" \ | ||
1280 | "\n" \ | ||
1281 | "ftpd should be used as an inetd service.\n" \ | ||
1282 | "ftpd's line for inetd.conf:\n" \ | ||
1283 | " 21 stream tcp nowait root ftpd ftpd /files/to/serve\n" \ | ||
1284 | "It also can be ran from tcpsvd:\n" \ | ||
1285 | " tcpsvd -vE 0.0.0.0 21 ftpd /files/to/serve\n" \ | ||
1286 | "\nOptions:" \ | ||
1287 | "\n -w Allow upload" \ | ||
1288 | "\n -v Log to stderr" \ | ||
1289 | "\n -S Log to syslog" \ | ||
1290 | "\n -t,-T Idle and absolute timeouts" \ | ||
1291 | "\n DIR Change root to this directory" \ | ||
1292 | |||
1293 | #define ftpget_trivial_usage \ | 1276 | #define ftpget_trivial_usage \ |
1294 | "[OPTIONS] HOST [LOCAL_FILE] REMOTE_FILE" | 1277 | "[OPTIONS] HOST [LOCAL_FILE] REMOTE_FILE" |
1295 | #define ftpget_full_usage "\n\n" \ | 1278 | #define ftpget_full_usage "\n\n" \ |
diff --git a/networking/ftpd.c b/networking/ftpd.c index 64068e467..b59135667 100644 --- a/networking/ftpd.c +++ b/networking/ftpd.c | |||
@@ -12,6 +12,23 @@ | |||
12 | * You have to run this daemon via inetd. | 12 | * You have to run this daemon via inetd. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | //usage:#define ftpd_trivial_usage | ||
16 | //usage: "[-wvS] [-t N] [-T N] [DIR]" | ||
17 | //usage:#define ftpd_full_usage "\n\n" | ||
18 | //usage: "Anonymous FTP server\n" | ||
19 | //usage: "\n" | ||
20 | //usage: "ftpd should be used as an inetd service.\n" | ||
21 | //usage: "ftpd's line for inetd.conf:\n" | ||
22 | //usage: " 21 stream tcp nowait root ftpd ftpd /files/to/serve\n" | ||
23 | //usage: "It also can be ran from tcpsvd:\n" | ||
24 | //usage: " tcpsvd -vE 0.0.0.0 21 ftpd /files/to/serve\n" | ||
25 | //usage: "\nOptions:" | ||
26 | //usage: "\n -w Allow upload" | ||
27 | //usage: "\n -v Log errors to stderr. -vv: verbose log" | ||
28 | //usage: "\n -S Log errors to syslog. -SS: verbose log" | ||
29 | //usage: "\n -t,-T Idle and absolute timeouts" | ||
30 | //usage: "\n DIR Change root to this directory" | ||
31 | |||
15 | #include "libbb.h" | 32 | #include "libbb.h" |
16 | #include <syslog.h> | 33 | #include <syslog.h> |
17 | #include <netinet/tcp.h> | 34 | #include <netinet/tcp.h> |
@@ -206,7 +223,7 @@ cmdio_write_error(unsigned status) | |||
206 | { | 223 | { |
207 | *(uint32_t *) G.msg_err = status; | 224 | *(uint32_t *) G.msg_err = status; |
208 | xwrite(STDOUT_FILENO, G.msg_err, sizeof("NNN " MSG_ERR) - 1); | 225 | xwrite(STDOUT_FILENO, G.msg_err, sizeof("NNN " MSG_ERR) - 1); |
209 | if (G.verbose > 1) | 226 | if (G.verbose > 0) |
210 | verbose_log(G.msg_err); | 227 | verbose_log(G.msg_err); |
211 | } | 228 | } |
212 | #define WRITE_ERR(a) cmdio_write_error(STRNUM32sp(a)) | 229 | #define WRITE_ERR(a) cmdio_write_error(STRNUM32sp(a)) |