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.

..wayne..
--- popt-1.14/popt.c    2008-03-08 08:20:20 -0800
+++ popt.c      2008-03-08 08:45:02 -0800
@@ -937,7 +937,7 @@ int poptGetNextOpt(poptContext con)
 
            origOptString++;
            if (*origOptString != '\0')
-               con->os->nextCharArg = origOptString;
+               con->os->nextCharArg = origOptString + (*origOptString == '=');
        }
 
        if (opt == NULL) return POPT_ERROR_BADOPT;      /* XXX can't happen */

Reply via email to