Bug 32558 - EN: add printing of defaults to a --help screen
Summary: EN: add printing of defaults to a --help screen
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: popt   
(Show other bugs)
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
URL:
Whiteboard:
Keywords: FutureFeature
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-03-21 19:44 UTC by Need Real Name
Modified: 2008-05-01 15:38 UTC (History)
0 users

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


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

Description Need Real Name 2001-03-21 19:44:19 UTC
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 19:47:34 UTC
Created attachment 13285 [details]
patch to allow defaults within --help

Comment 2 Need Real Name 2001-03-21 19:58:58 UTC
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 22:36:45 UTC
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-17 00:25:43 UTC
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.