This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 32558 - EN: add printing of defaults to a --help screen
EN: add printing of defaults to a --help screen
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: popt (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-03-21 14:44 EST by Need Real Name
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-03-22 17:36:49 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
patch to allow defaults within --help (4.40 KB, patch)
2001-03-21 14:47 EST, Need Real Name
no flags Details | Diff

  None (edit)
Description Need Real Name 2001-03-21 14:44:19 EST
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
Comment 1 Need Real Name 2001-03-21 14:47:34 EST
Created attachment 13285 [details]
patch to allow defaults within --help
Comment 2 Need Real Name 2001-03-21 14:58:58 EST
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).
Comment 3 Jeff Johnson 2001-03-22 17:36:45 EST
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.
Comment 4 Jeff Johnson 2001-06-16 20:25:43 EDT
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
:-)

Note You need to log in before you can comment on or make changes to this bug.