From Bugzilla Helper: User-Agent: Mozilla/4.72 [en] (X11; U; Linux 2.2.14-5.0 i686) This patch allows --help to print the default values of the variables passed to popt. the display of test1 would look like this: Usage: test1 [OPTION...] --arg1 First argument with a really long description. After all, we have to test argument help wrapping somehow, right? -2, --arg2=ARG Another argument -3, --arg3=ANARG A third argument --shortoption Needs a single - --unused=UNUSED Unused option for help testing --default-string-long=ARG Unused option for help testing [default: 'This is a long default value (>50char) for option tes...'] --default-string-null=ARG Unused option for help testing [default: '(null)'] --def-int=ARG Unused option for help testing [default: 456231] --def-long=ARG Unused option for help testing [default: 464483271] --- etc --- i added POPT_ARGFLAG_SHOW_DEFAULT which is or'd into the argInfo and causes things to be displayed. the patch will show the example of the code. Reproducible: Always Steps to Reproduce: enhancement, not bug
Created attachment 13285 [details] patch to allow defaults within --help
let me add that i run rh62, but i run popt taken from rpm 4.0.? and my code was based again popt 1.6 (ala rpm 4.0.x). (thus, i changed the rh version of this bug).
Could you take a look at popt-1.6.2 (with rpm-4.0.2 sources) and consider integrating your patch with the changes there? Thanks.
I finally merged your patch into popt-1.6.3-0.42. I decided to append default values to the end of the help string rather than messing with the existing format. Thanks for the patch (and the patience :-)