Red Hat Bugzilla – Bug 205849
popt should support required options
Last modified: 2007-11-30 17:11:42 EST
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).
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?
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
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).
User firstname.lastname@example.org's account has been closed
Reassigning to owner after bugzilla made a mess, sorry about the noise...
IMHO this problem is solved in 1.12-3, which should reach Rawhide soon. If not,
please reopen this bug report.