RPM Community Forums

Mailing List Message of <popt-devel>

Permit arg units (like 100Kb), add getdate?

From: Jeff Johnson <n3npq@mac.com>
Date: Thu 01 May 2008 - 19:08:23 CEST
Message-id: <5786A52E-DE69-45F2-A8D5-9103DB6243AC@mac.com>
While using popt in another program, I came across 2 usage
cases that might be usefully internalized in popt.

One usage case was an attempt to specify a memory limit as
     --memory 16777216
Adding unit scaling, e.g.
     --memory 16Mb
     --memory 16384Kb
would not be hard to add using something like
     POPT_ARG_INT | POPT_ARGFLAG_UNITS
with the usual Kb/Kib Mb/Mib Gb/Gib tokens to prescale.

Another possible popt-1.15 usage case is getdate.y, which is wonderfully
useful for time/date argument input. While it is
rather easy to use getdate.y through a popt callback, perhaps
its time to push getdate.y into libpopt, and add a
     POPT_ARG_DATE
distinguished method to make it as easy as possible to use getdate.y.

I'm also seeing a need for a KEY=VALUE comma separated list popt
sub-table option parser (there's a mouthful ;-)

I'm starting to see
     --option K1=V1,K2=V2,K3=V3
occurrences more often. I can think of a couple ways to use popt
to recursively parse KEY=VALUE settings, either by keeping track
of a chained popt table that is used iff a specific --option is  
encountered,
or by overloading the pointer field to be used as a option specific
subtable parse.

Opinions?

73 de Jeff
Received on Thu May 1 19:08:55 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.