Re: Allow equal after a short option

2008-03-09 Thread Wayne Davison
On Sun, Mar 09, 2008 at 07:10:21PM -0400, Jeff Johnson wrote: > Your original patch for -c=foo is now checked in. Cool! You should also be able to uncomment the extra tests now. ..wayne.. __ POPT Library

Re: Allow equal after a short option

2008-03-09 Thread Jeff Johnson
On Mar 9, 2008, at 6:36 PM, Wayne Davison wrote: On Sat, Mar 08, 2008 at 12:10:52PM -0500, Jeff Johnson wrote: Running test test1 - 9. Test "test1 -2 foo" failed with: "arg1: 0 arg2: rest: foo" != "arg1: 0 arg2: foo" I can get that failure if the line I added does not replace the prior assi

Re: echo incompatibility (was Re: Allow equal after a short option)

2008-03-09 Thread Jeff Johnson
On Mar 9, 2008, at 6:22 PM, Wayne Davison wrote: On Sun, Mar 09, 2008 at 10:51:42AM -0400, Jeff Johnson wrote: [EMAIL PROTECTED] popt]$ /bin/echo --foo --bar --bar [EMAIL PROTECTED] popt]$ /bin/echo -- --foo --bar --foo --bar OK, Let's hope that your echo will not drop anything if the first

Re: Allow equal after a short option

2008-03-09 Thread Wayne Davison
On Sat, Mar 08, 2008 at 12:10:52PM -0500, Jeff Johnson wrote: > Running test test1 - 9. > Test "test1 -2 foo" failed with: "arg1: 0 arg2: rest: foo" != "arg1: > 0 arg2: foo" I can get that failure if the line I added does not replace the prior assignment (which makes it affect the case where *o

echo incompatibility (was Re: Allow equal after a short option)

2008-03-09 Thread Wayne Davison
On Sun, Mar 09, 2008 at 10:51:42AM -0400, Jeff Johnson wrote: > [EMAIL PROTECTED] popt]$ /bin/echo --foo --bar > --bar > [EMAIL PROTECTED] popt]$ /bin/echo -- --foo --bar > --foo --bar OK, Let's hope that your echo will not drop anything if the first arg passed to it is a non-option (such as "args

Re: Allow equal after a short option

2008-03-09 Thread Jeff Johnson
On Mar 9, 2008, at 5:38 PM, Wayne Davison wrote: On Sun, Mar 09, 2008 at 10:51:42AM -0400, Jeff Johnson wrote: Meanwhile, below is a rewrite of POPT_fprintf, essentially identical to the "man vsnprintf" example. See what you think ... Looks good. I did some tweaking based on this code. The

Re: Allow equal after a short option

2008-03-09 Thread Wayne Davison
On Sun, Mar 09, 2008 at 10:51:42AM -0400, Jeff Johnson wrote: > Meanwhile, below is a rewrite of POPT_fprintf, essentially identical > to the "man vsnprintf" example. See what you think ... Looks good. I did some tweaking based on this code. The attached patch changes what you checked-in to CVS.

RE: Allow equal after a short option

2008-03-09 Thread Wichmann, Mats D
> [EMAIL PROTECTED] popt]$ /bin/echo --foo --bar > --bar > [EMAIL PROTECTED] popt]$ /bin/echo -- --foo --bar > --foo --bar > Heh, I believe the answer starts to become clearer: > The echo(1) from Fedora coreutils-6.10-4.fc9.i386 dares to be different. > The root cause is what I needed to underst

Re: Allow equal after a short option

2008-03-09 Thread Jeff Johnson
On Mar 9, 2008, at 10:51 AM, Jeff Johnson wrote: while ((b = realloc(b, nb)) != NULL) { va_start(ap, format); rc = vsnprintf(b, nb, format, ap); va_end(ap); if (rc < -1 && (size_t)rc < nb) This should have been if (rc > -1 && (size_t)rc < nb)

Re: Allow equal after a short option

2008-03-09 Thread Jeff Johnson
On Mar 9, 2008, at 10:14 AM, Wayne Davison wrote: On Sun, Mar 09, 2008 at 12:42:37AM -0500, Jeff Johnson wrote: /bin/echo on my system is unmodified from Fedora 9 coreutils-6.10-4.fc9.i386 Interesting. So, what do you get with a manual run? /bin/echo --foo --bar /bin/echo -- --foo

Re: Allow equal after a short option

2008-03-09 Thread Wayne Davison
On Sun, Mar 09, 2008 at 12:42:37AM -0500, Jeff Johnson wrote: > /bin/echo on my system is unmodified from > Fedora 9 coreutils-6.10-4.fc9.i386 Interesting. So, what do you get with a manual run? /bin/echo --foo --bar /bin/echo -- --foo --bar I see all the option information output lit

Re: Allow equal after a short option

2008-03-08 Thread Jeff Johnson
On Mar 8, 2008, at 11:24 PM, Wayne Davison wrote: On Sat, Mar 08, 2008 at 06:11:09PM -0500, Jeff Johnson wrote: Hmmm, we appear to have different behavior wrto echo. Your patch changes testit.sh to include an explicit "--", which (when I last fixed testit.sh like 3 weeks ago) does not appear i

Re: Allow equal after a short option

2008-03-08 Thread Wayne Davison
On Sat, Mar 08, 2008 at 06:11:09PM -0500, Jeff Johnson wrote: > Hmmm, we appear to have different behavior wrto echo. Your > patch changes testit.sh to include an explicit "--", which (when > I last fixed testit.sh like 3 weeks ago) does not appear in the > output I am (and was) seeing. I tried i

Re: Allow equal after a short option

2008-03-08 Thread Jeff Johnson
On Mar 8, 2008, at 12:56 PM, Wayne Davison wrote: On Sat, Mar 08, 2008 at 12:10:52PM -0500, Jeff Johnson wrote: Test "test1 -2 foo" failed with: "arg1: 0 arg2: rest: foo" != "arg1: 0 arg2: foo" I'm not seeing that error with the CVS version. I do note that my prior patch to fix the longA

Re: Allow equal after a short option

2008-03-08 Thread Jeff Johnson
On Mar 8, 2008, at 12:56 PM, Wayne Davison wrote: On Sat, Mar 08, 2008 at 12:10:52PM -0500, Jeff Johnson wrote: Test "test1 -2 foo" failed with: "arg1: 0 arg2: rest: foo" != "arg1: 0 arg2: foo" I'm not seeing that error with the CVS version. I do note that my prior patch to fix the longA

Re: Allow equal after a short option

2008-03-08 Thread Wayne Davison
On Sat, Mar 08, 2008 at 12:10:52PM -0500, Jeff Johnson wrote: > Test "test1 -2 foo" failed with: "arg1: 0 arg2: rest: foo" != "arg1: > 0 arg2: foo" I'm not seeing that error with the CVS version. I do note that my prior patch to fix the longArg pointer (e.g. "./test1 -2foo=bar") isn't there, b

Re: Allow equal after a short option

2008-03-08 Thread Jeff Johnson
On Mar 8, 2008, at 12:02 PM, Wayne Davison wrote: I think it would be nice to allow an equal to separate a short option letter from its abutting argument. e.g. these commands using the test1 executable would all work the same: ./test1 -2 foo ./test1 -2=foo ./test1 -2foo ./test1 --arg2