Re: required options
David Allouche <[email protected]> Thu, 09 Sep 2004 09:33:59 +0200
| Newsgroups | gmane.comp.python.optik.user |
|---|---|
| Message-ID | <1094715239.7651.199.camel@nemesis> |
On Thu, 2004-09-09 at 17:07 +1000, Robert Collins wrote:
> On Thu, 2004-09-09 at 09:01 +0200, Thorsten Kampe wrote:
> > The manual states that users often want "required (mandatory) options"
> > which is contradictory in itself. The manual suggests using positional
> > arguments instead.
> >
> > I think this is some kind of misunderstanding. Positional arguments
> > are often not usable because only the position makes the argument the
> > source or the destination for example. It's not always as simple and
> > obvious as with "cp" (for instance I always get it wrong with "ln -s
> > TARGET LINK_NAME").
>
>
> Sure they are: here's a revamped ln:
>
> ln -s target TARGET linkname LINK_NAME
>
> where that is four arguments, two fixed value strings, two the user
> chooses....
Which is not distinguishable from "ln -s TARGET ... DIRECTORY".
Probably the correct usage would more be along the lines of
[existing ln usage, plus...]
ln [OPTION]... --symbolic --target TARGET LINK_NAME
ln [OPTION]... --symbolic --target TARGET --link-name LINK_NAME
ln [OPTION]... --symbolic --link-name LINK_NAME TARGET
That would be a variation of the duality between these two existing
usages:
ln [OPTION]... TARGET... DIRECTORY
ln [OPTION]... --target-directory DIRECTORY TARGET...
> if you want to do that, that is. I agree with the Tao though, if
> something is mandatory, it is not an 'option'.
Same idea here. If you end up with mandatory options, you probably have
to rethink your CLI. You do not want to end up like gpg, do you?
--
-- ddaa
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click