Subject: Re: [PATCH ethtool 5/5] ethtool: Add --version option

From: Jeff Garzik <[email-masked]>
Date: Tue, 22 Feb 2011 16:35:16 -0500

On 02/22/2011 08:05 AM, Eric Dumazet wrote:
> Le mardi 22 février 2011 à 12:37 +0000, Ben Hutchings a écrit :
>> On Mon, 2011-02-21 at 22:16 -0800, Stephen Hemminger wrote:
>> [...]
>>> The standard convention is to use -V for short form of version option.
>>
>> This is not anywhere near standard.
>>
>> $ cp -V
>> cp: invalid option -- 'V'
>> Try `cp --help' for more information.
>> $ bash -V
>> bash: -V: invalid option
>> [...]
>> $ emacs -V
>> [opens window]
>> $ vim -V
>> chdir(/usr/share/vim)
>> fchdir() to previous dir
>> sourcing "$VIM/vimrc"
>> [...looks like that meant 'verbose'...]
>
> Now try with networking tools, many use -V
>
> (As a matter of fact, ethtool -h already is used to display help)
>
> # ping -V
> ping utility, iputils-sss20071127
> # tc -V
> tc utility, iproute2-ss100823
> # ssh -V
> OpenSSH_5.1p1 Debian-5, OpenSSL 0.9.8g 19 Oct 2007

Stephen is correct, "-V" is a common standard (but by no means 
universal).  The following is what using argp ("info argp") generates 
for any program by default:

> Usage: myprog [OPTION...]
> myprog - a program that does something
>
> [...]
>
>   -?, --help                 Give this help list
>       --usage                Give a short usage message
>   -V, --version              Print program version
>
> Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options.

Regards,

	Jeff