On Mon, May 16, 2005 at 08:35:47PM +0200, No�l K�the wrote:
> # lftp -u foo --help
> lftp: unrecognized option `--help'
> Try `lftp --help' for more information

This patch should fix this problem:

Index: commands.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/commands.cc,v
retrieving revision 1.222
retrieving revision 1.223
diff -u -p -r1.222 -r1.223
--- commands.cc 19 May 2005 05:47:31 -0000      1.222
+++ commands.cc 19 May 2005 12:41:11 -0000      1.223
@@ -18,7 +18,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-/* $Id: commands.cc,v 1.222 2005/05/19 05:47:31 lav Exp $ */
+/* $Id: commands.cc,v 1.223 2005/05/19 12:41:11 lav Exp $ */
 
 #include <config.h>
 
@@ -743,10 +743,11 @@ Job *CmdExec::builtin_open()
       {"execute",required_argument,0,'e'},
       {"debug",optional_argument,0,'d'},
       {"no-bookmark",no_argument,0,'B'},
+      {"help",no_argument,0,'h'},
       {0,0,0,0}
    };
 
-   while((c=args->getopt_long("u:p:e:dB",open_options,0))!=EOF)
+   while((c=args->getopt_long("u:p:e:dBh",open_options,0))!=EOF)
    {
       switch(c)
       {
@@ -775,6 +776,12 @@ Job *CmdExec::builtin_open()
       case('B'):
         no_bm=true;
         break;
+      case('h'):
+        if(!strcmp(op,"lftp"))
+        {
+           PrependCmd("help lftp");
+           return 0;
+        }
       case('?'):
         if(!strcmp(op,"lftp"))
            eprintf(_("Try `%s --help' for more information\n"),op);

-- 
   Alexander.

Reply via email to