Re: GNU/Linux stance by Richard Stallman

Riley Williams (rhw@BigFoot.Com)
Tue, 6 Apr 1999 10:55:30 +0100 (GMT)


Hi Kevin.

>> Not sure. Although '--help' and '--version' act as exceptions,
>> they also create a rule: every program must identify itself and
>> provide some help. After all we are not talking about spiffy
>> copyright string here. I think the advantage of making UNIX more
>> user friendly is well worth it.

The problem is that they do NOT create a rule - at least, not a
standard one. Let's take a few examples:

1. insmod accepts --version but NOT --help

2. procinfo does not accept either.

3. pstree does not accept either.

ALL THREE of the above have options to show both help and version, so
that part of the rule has been complied with, but the requirement for
them to use --help and --version have not.

>> Of course, this will definitely break some pereverted script that
>> calls 'true' with the arguments above. :-)

> It may not be perverted. What if you have a script that has the
> option of excluding a certain command from running (think of the
> weird stuff in autoconf) so you use

> $(COMMAND) "$@"

> a lot in your script and COMMAND="/usr/bin/frob" but if
> /etc/nofrob exists you set COMMAND="/bin/true" which effectively
> turns off $(COMMAND) without the need for a if/fi block around
> EVERY call to it and it always succeeds.

Personally, I would use the following in those circumstances:

Q> if [ -e /etc/nofrob ]; then
Q> alias frob 'echo > /dev/null'
Q> else
Q> alias frob /usr/bin/frob
Q> fi

I would then just use frob as the command, and allow alias to turn it
into the desired version...

> Unless someone puts --version into the command line (which may
> not get sucked up by your script if the "$@" was a $3 instead!

Note that both /bin/false and /bin/true REQUIRE that both --version
and --help are the ONLY option supplied before they act on them. As a
result, this would only be a possible problem on lines where there was
only a single parameter.

> To me, that doesn't sound like a very perverted situation, but
> that may say something about me :-)

True 8-)

Best wishes from Riley.

+----------------------------------------------------------------------+
| There is something frustrating about the quality and speed of Linux |
| development, ie., the quality is too high and the speed is too high, |
| in other words, I can implement this XXXX feature, but I bet someone |
| else has already done so and is just about to release their patch. |
+----------------------------------------------------------------------+
* ftp://ftp.MemAlpha.cx/pub/rhw/Linux
* http://www.MemAlpha.cx/kernel.versions.html

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/