Re: [PATCH 0/25] Usage message clean-up

From: A Large Angry SCM <gitzilla@gmail.com>
Date: 2005-12-11 09:13:57
freku045@student.liu.se wrote:
...
> I have tried to follow the following rules:
> 
> * Any unrecognised options should make the script die with the usage
>   message.

Good.

> * -h and --help makes the script die with the usage message.

This should not be an error. The user was asking for the usage message.

> * The message is printed to stderr.

Good unless the message was printed due to -h or --help, then it should 
go to stdout.

> * The message is of the form "usage: $0 options"
> 
> I am not convinced that the last bullet point is the best way to do
> things. Using "$0" is probably best for Git developers but using "git
> program-name" is probably least confusing for users, especially if we
> are going to move the git-* binaries away from /usr/bin. Another
> option is "basename $0". What do you think?

Not using $0 can make it _extremely_ annoying to determine exactly which 
program printed the usage message. It may look prettier without the path 
but if I have more that one $(basename $0) it may not be trivial to 
determine the one that issued the message. Also keep in mind that is it 
possible to have spaces in names of executables. So, "foo-bar" and "foo 
bar" may be two different executables.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Sun Dec 11 09:15:31 2005

This archive was generated by hypermail 2.1.8 : 2005-12-11 09:15:37 EST