From: "Benno Schulenberg" <bensberg@justemail.net>
To: kerolasa@gmail.com
Cc: "Karel Zak" <kzak@redhat.com>, "util-linux" <util-linux@vger.kernel.org>
Subject: Re: man-pages and usage() howto
Date: Mon, 22 Aug 2011 22:38:19 +0200 [thread overview]
Message-ID: <1314045499.25233.140258132498281@webmail.messagingengine.com> (raw)
In-Reply-To: <CAG27Bk0m45JFtP2MNz27tgJ=-f5XZDHUtd1C9O4X0ALO52-BVA@mail.gmail.com>
On Sat, 20 Aug 2011 21:08 +0200, "Sami Kerola" <kerolasa@iki.fi> wrote:
> On Sat, Aug 20, 2011 at 11:10, Benno Schulenberg <bensberg@justemail.net> wrote:
> > On Wed, 17 Aug 2011 15:07 +0200, "Sami Kerola" <kerolasa@iki.fi> wrote:
> >> Having also definition for OPTION_HELP && OPTION_VERSION would be
> >> good.
> >
> > That won't work -- the amount of indentation for the option description
> > is not the same for all utilities. And to make it the same for all would
> > create ugly and unneeded wide open text spaces for some tools.
>
> To me it does not sound a big deal if --help and --version
> description begins from different indent than rest of lines. I
> wrote example output that way, so that you can judge how that
> will look.
When --help and --version are always the last two options of the
usage help text, a differing indentation is acceptable. But if --help
is ordered alphabetically, it will look broken.
> \fB\-o\fR, \fB\-\-optional\fR[=<\fIarg\fR>]
> This option uses optional argument.
As Karel said, the majority convention now is to not use pointy brackets
for arguments in man pages. The italics/underlining is enough to make
them stand out.
I would also suggest to not use "arg" but the full word "argument", so as
to encourage writers to not unnecessarily abbreviate the argument name,
to use for example "seconds" and not "secs", use "number" and not "num".
A thing about the formatting: why us \fB and \fR and \fB and \fR?
Why not use the macro .BR at the start of the line instead?
(I do not understand your comment about some macros not being
visually different from plain .B or .I.)
Another thing: the man page formatter itself puts a double space after a
period when in the man page source the next sentence begins on a new
line. So when in the source a new sentence begins somewhere midline,
it should use a double space before its initial letter.
>From your usage howto:
> -n, --no-argument option requires no_argument
> -o, --optional[=<arg>] option has optional_argument
> -r, --required <arg> option requires required_argument
Why the underscores? I would suggest the following:
-n, --no-argument option takes no argument
-o, --optional[=<arg>] option takes optional argument
-r, --required <arg> option requires an argument
(As in a usage text space is limited, abbreviations are okay.)
Regards,
Benno
--
http://www.fastmail.fm - Access your email from home and the web
next prev parent reply other threads:[~2011-08-22 20:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-15 14:19 man-pages and usage() howto Karel Zak
2011-08-15 19:12 ` Sami Kerola
2011-08-16 9:03 ` Benno Schulenberg
2011-08-16 10:46 ` Karel Zak
2011-08-17 13:07 ` Sami Kerola
2011-08-20 9:10 ` Benno Schulenberg
2011-08-20 19:08 ` Sami Kerola
2011-08-21 10:56 ` Sami Kerola
2011-08-22 8:16 ` Karel Zak
2011-08-22 18:53 ` Sami Kerola
2011-08-22 20:38 ` Benno Schulenberg [this message]
2011-08-23 8:15 ` Sami Kerola
2011-08-23 18:55 ` Benno Schulenberg
2011-08-23 19:34 ` Sami Kerola
2011-08-16 10:39 ` Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1314045499.25233.140258132498281@webmail.messagingengine.com \
--to=bensberg@justemail.net \
--cc=kerolasa@gmail.com \
--cc=kzak@redhat.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox