Thread (4 messages) 4 messages, 3 authors, 2016-06-15

Re: [PATCH] CodingGuidelines: Add a section on writing documentation

From: Mark Lodato <hidden>
Date: 2016-06-15 22:49:56

Possibly related (same subject, not in this thread)

On Sun, Oct 24, 2010 at 11:51 AM, Štěpán Němec [off-list ref] wrote:
Provide a few examples on argument and option notation in usage strings
and command synopses.
I think this is a great idea.
+ Specific number of occurences is indicated as follows:
+   <commit>{0,2}
+   (Up to two <commit>s.)
I suggest removing this notation - it is confusing and is only used by
git-diff.txt and git-difftool.txt.  We already have notation to serve
this purpose:

    [<commit> [<commit>]]
+ Parentheses are used for grouping, often combined with vertical bar
+ to indicate alternatives:
+   [(<rev>|<range>)...]
+   (Any number of either <rev> or <range>.  Parens are needed to make
+   it clear that "..." pertains to both <rev> and <range>.)
You could also mention that parentheses are not needed if square
brackets will do:
    [-q | --quiet]

Also, should there be a standard for spacing and for whether the short
or the long option comes first?

git-add.txt:
    [--patch | -p]
git-commit.txt:
    [-a | --interactive]
git-stash.txt:
    [-q|--quiet]

Otherwise, I think this patch looks good.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help