On Tue, Oct 14, 2003 at 10:14:38PM +0200, No?l K?the wrote:
> "When lftp gets an option that it doesn't understand, it only mentions
> the first character after the first '-' as the invalid option.
>
> $ lftp -bogus
> lftp: invalid option -- b
> Try `lftp --help' for more information
This is how standard GNU getopt works.
> $ lftp --bogus
> lftp: invalid option -- -
> Try `lftp --help' for more information
Now this should be fixed, as -- stands for long options. Patch attached.
--
Alexander.
Index: commands.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/commands.cc,v
retrieving revision 1.194
diff -u -p -r1.194 commands.cc
--- commands.cc 10 Oct 2003 11:39:30 -0000 1.194
+++ commands.cc 21 Oct 2003 07:58:49 -0000
@@ -724,8 +724,18 @@ Job *CmdExec::builtin_open()
bool insecure=false;
bool no_bm=false;
+ static struct option open_options[]=
+ {
+ {"port",required_argument,0,'p'},
+ {"user",required_argument,0,'u'},
+ {"execute",required_argument,0,'e'},
+ {"debug",optional_argument,0,'d'},
+ {"no-bookmark",no_argument,0,'B'},
+ {0,0,0,0}
+ };
+
args->rewind();
- while((c=args->getopt("u:p:e:dB"))!=EOF)
+ while((c=args->getopt_long("u:p:e:dB",open_options,0))!=EOF)
{
switch(c)
{