RPM Community Forums

Mailing List Message of <popt-devel>

Re: Disallowing args

From: Wayne Davison <wayned@samba.org>
Date: Sat 05 Jun 2010 - 18:48:54 CEST
Message-ID: <AANLkTin8hPpIH5SF-ES0G6930QseUAC5XrJeN6S0HbBK@mail.gmail.com>
On Sat, Jun 5, 2010 at 8:56 AM, Jeff Johnson <n3npq@mac.com> wrote:

> but
>        --foo bar
> returns bar in the argument list?

Yes.  The user may well have wanted it to be in the arg list.  There's no
way for the program to know that the user didn't just toss some options in
the middle of some args (which I do all the time these days, like starting
my rsync source/dest args, and then tossing in a --remove-source-files,
--backup, or what-not at wherever I am in the list), so I wouldn't want to
see an error for something like this:

rsync -aiv --del file --remove-source-args some/dir host:/dest/dir

... just because --del doesn't take an arg.

The other way to "fix" the error is to morph "--foo=bar" behavior to be
> identical to "--foo bar", i.e. an extra argument failure.

I don't see how that would work for something like rsync that takes any
number of command-line args outside the options.

Anything you want to see in POPT 2.0? I'm collecting features ...

A couple ideas off the top of my head:

   - An incrementing option -- repeated use adds 1 to the variable instead
   of setting it to the same value.
   - Multiple long names separated by "|" in the long-name string (though
   that could really just be defined as an alias, it might be nice to auto-gen
   the alias).

Received on Sat Jun 5 18:49:12 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.