Re: man-pages and usage() howto

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

 



On Mon, 15 Aug 2011 21:12 +0200, "Sami Kerola" <kerolasa@xxxxxx> wrote:
> On Mon, Aug 15, 2011 at 16:19, Karel Zak <kzak@xxxxxxxxxx> wrote:
> >  * argument required:
> >
> >   -o, --option FILE    # usage()
> >   -o, --option file    # man page
> 
> I used GNU notation which has 'unnecessary' equals sign.
> 
> -o, --option=FILE

The full GNU style seems to be this (for example in 'man grep'):

  -o FILE, --option=FILE

Since the util-linux man pages don't put the argument after the short
version of the option, the '  -o, --option FILE' variant would be for me
the logical condensed intersection.  Also, why give the impression
that the equals sign is needed when it is not?
 
> The only reason I can think of why the equal sign is there is visual
> similarity with optional argument... [...]
> 
> I also acknowledge the fact that no-one will ever use equals sign when
> giving required argument. The practise of dropping it is a rational
> reason not to specify it to usage() or man. I would say this is a
> question of choosing a convention in between visual symmetry or actual
> habits of people. IMHO the visual unity is better.

IMHO visual contrast is better.  When my fleeting glance sees an equals
sign OR square brackets, I know the argument is optional; when it does
not see an equals sign OR does not see square brackets, the argument is
required.  Redundancy is good.


> >        command [options] file

If in the usage() help text the arguments of options are written in
uppercase, wouldn't it be more consistent to then also write the
arguments of the command itself in uppercase (as for example
'man -h' and 'grep --help' do)?

        command [OPTIONS] FILE

(Also, to be fully correct, it would have to say "[OPTION...]" instead,
but I will let that go.)

About the other things I have not yet an opinion.

Regards,

Benno

-- 
http://www.fastmail.fm - Access all of your messages and folders
                          wherever you are

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux