Bug 205849 - popt should support required options
popt should support required options
Product: Fedora
Classification: Fedora
Component: popt (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Robert Scheck
Fedora Extras Quality Assurance
Depends On: 249352
  Show dependency treegraph
Reported: 2006-09-08 19:44 EDT by Ben
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version: 1.12-3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-08-23 19:17:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ben 2006-09-08 19:44:18 EDT
maybe I'm missing something, but it doesn't seem that there's any way to mark an
entry in popt's option table as required. I can certainly error out if it's not
specified, but it would be nice if the auto-generated help could mark it as
required. As it is right now, all options are marked as optional in the
auto-generated help (dennoted by [], as opposed to <> for required).
Comment 1 Jeff Johnson 2006-09-11 20:09:54 EDT
What exactly are you asking for? It appears you want to see <...>
rather than [...] in --help output, but I have no idea what output
you are looking at.

Can you supply an example?

Comment 2 Ben 2006-09-11 22:05:01 EDT
woops, sorry. An example for, say, cp, might be:

cp [-p] [-r] <src [src2 [src3]]> <dst>

Basically, somehow denote that -p, -r, src2, and src3 are all optional options,
but that src and dst are required "options". If I'm not seeing something, or if
there's another way to denote that optional vs. required info, then please clue
me in.
Comment 3 Jeff Johnson 2006-09-12 10:34:32 EDT
popt provides 2 means to display help automagically, a short form with --usage,
and a long form with --help.

Unfortunately, there ios no means currently to mark an option as required, so there's
no easy way to use <...> instead of [...] displaying options. The short form display
with --usage is different than your example as well.

You could choose to add "REQUIRED" string to the long description displayed with --help.

I'll take a look this weekend at the feasibility of adding a POPT_ARGFLAG_REQURED marker
so that the output display might use <...> and [...] somewhen.

But please note that there are so many older versions of popt floating around that
you're unlikely to see the change soon (assuming that I'm successful).
Comment 4 Red Hat Bugzilla 2007-08-21 01:25:40 EDT
User pnasrat@redhat.com's account has been closed
Comment 5 Panu Matilainen 2007-08-22 02:29:58 EDT
Reassigning to owner after bugzilla made a mess, sorry about the noise...
Comment 6 Robert Scheck 2007-08-23 19:17:26 EDT
IMHO this problem is solved in 1.12-3, which should reach Rawhide soon. If not, 
please reopen this bug report.

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