gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] [BUG] tla dosen't handle '--' as end of option argu


From: John Meinel
Subject: Re: [Gnu-arch-users] [BUG] tla dosen't handle '--' as end of option argument
Date: Sun, 12 Sep 2004 08:52:27 -0500
User-agent: Mozilla Thunderbird 0.7 (Windows/20040616)

Aaron Bentley wrote:

John Meinel wrote:

So I have to wonder. Why can't "tla undo", et. al. just take a list of filenames. So that if I type:
    tla undo
It does a standard undo, but if I use
    tla undo file1 file2
It says, hey, there are specifically listed files, lets only undo them.


No reason it can't, and in fact, the Fai equivalent, "revert" does that. But undo also takes a revision/version argument as the first positional parameter, so you'll need to figure out what to do with it. In Fai, it's a comand switch, but I'm still not used to that. I keep specifying the revision as a positional parameter.

Another nice thing about Gnuish tools is that you can intermix switches and positional parameters. I wish tla had that.

Aaron

There is a really nice library that handles the 'gnu-ish' parameters
called popt (or possibly libpopt). It is used by rpm (and almost every
program I've written.). It is much more advanced (to me) that getopt.

Basically, you set up structures in advance that list all the parameters
that you are interested in parsing, along with the variable that should
contain their arguments.

It is quite flexible, but handles most of the argument parsing details.
(It even has an aliases system, so that a person can create their own
argument aliases. Don't like typing "tla logs -sDr", remap it to "tla
logs -a". I just wish there was an easier way to setup *default* options.)

John
=:->



Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]