RPM Community Forums

Mailing List Message of <popt-devel>

Re: Allow equal after a short option

From: Jeff Johnson <n3npq@mac.com>
Date: Sat 08 Mar 2008 - 18:10:52 CET
Message-Id: <CDF96A60-476C-4747-89BF-C42370986D86@mac.com>

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 foo
>  ./test1 --arg2=foo
> Since this has been a syntax error in released versions of popt, this
> should not cause a compatibility problem.  This fix requires my prior
> patch to make sure that short-option parsing doesn't have longArg set.

I think the patch is a reasonable extension, but there's more to do:

[jbj@wellfleet popt]$ make check
make  check-TESTS
make[2]: Entering directory `/X/src/popt'
Running tests in /X/src/popt
Running test test1 - 1.
Running test test1 - 2.
Running test test1 - 3.
Running test test1 - 4.
Running test test1 - 5.
Running test test1 - 6.
Running test test1 - 7.
Running test test1 - 8.
Running test test1 - 9.
Test "test1 -2 foo" failed with: "arg1: 0 arg2:  rest: foo" != "arg1:  
0 arg2: foo"

Would you mind looking at the problem? Thanks ...

73 de Jeff
Received on Sat Mar 8 18:10:57 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.