ftpd: better usage text
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 8 Mar 2011 02:01:10 +0000 (03:01 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 8 Mar 2011 02:01:10 +0000 (03:01 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
include/usage.src.h
networking/ftpd.c

index df770c45462236f68cf1c64ae00cc0fd5d698673..5a725e3051c29ff601c9f63881a1463a85aeefb4 100644 (file)
@@ -1273,23 +1273,6 @@ INSERT
      "\n       -m      Show \"mode not cleared\" warnings" \
      "\n       -f      Force file system check" \
 
-#define ftpd_trivial_usage \
-       "[-wvS] [-t N] [-T N] [DIR]"
-#define ftpd_full_usage "\n\n" \
-       "Anonymous FTP server\n" \
-       "\n" \
-       "ftpd should be used as an inetd service.\n" \
-       "ftpd's line for inetd.conf:\n" \
-       "       21 stream tcp nowait root ftpd ftpd /files/to/serve\n" \
-       "It also can be ran from tcpsvd:\n" \
-       "       tcpsvd -vE 0.0.0.0 21 ftpd /files/to/serve\n" \
-     "\nOptions:" \
-     "\n       -w      Allow upload" \
-     "\n       -v      Log to stderr" \
-     "\n       -S      Log to syslog" \
-     "\n       -t,-T   Idle and absolute timeouts" \
-     "\n       DIR     Change root to this directory" \
-
 #define ftpget_trivial_usage \
        "[OPTIONS] HOST [LOCAL_FILE] REMOTE_FILE"
 #define ftpget_full_usage "\n\n" \
index 64068e46761521286e8c23122fb5fd4f746a484e..b5913566700e835bf2f1dbbed4c53ab1b071136d 100644 (file)
  * You have to run this daemon via inetd.
  */
 
+//usage:#define ftpd_trivial_usage
+//usage:       "[-wvS] [-t N] [-T N] [DIR]"
+//usage:#define ftpd_full_usage "\n\n"
+//usage:       "Anonymous FTP server\n"
+//usage:       "\n"
+//usage:       "ftpd should be used as an inetd service.\n"
+//usage:       "ftpd's line for inetd.conf:\n"
+//usage:       "       21 stream tcp nowait root ftpd ftpd /files/to/serve\n"
+//usage:       "It also can be ran from tcpsvd:\n"
+//usage:       "       tcpsvd -vE 0.0.0.0 21 ftpd /files/to/serve\n"
+//usage:     "\nOptions:"
+//usage:     "\n       -w      Allow upload"
+//usage:     "\n       -v      Log errors to stderr. -vv: verbose log"
+//usage:     "\n       -S      Log errors to syslog. -SS: verbose log"
+//usage:     "\n       -t,-T   Idle and absolute timeouts"
+//usage:     "\n       DIR     Change root to this directory"
+
 #include "libbb.h"
 #include <syslog.h>
 #include <netinet/tcp.h>
@@ -206,7 +223,7 @@ cmdio_write_error(unsigned status)
 {
        *(uint32_t *) G.msg_err = status;
        xwrite(STDOUT_FILENO, G.msg_err, sizeof("NNN " MSG_ERR) - 1);
-       if (G.verbose > 1)
+       if (G.verbose > 0)
                verbose_log(G.msg_err);
 }
 #define WRITE_ERR(a) cmdio_write_error(STRNUM32sp(a))