# is the standard "[<options>]", and not "[options]" or other?

2 messages from 2018-05-24 to 2018-05-24. Participants: Robert P. J. Day, Stefan Beller.
Thread: https://gitlist.dev/t/48562

## Robert P. J. Day, 2018-05-24 11:45

Subject: is the standard "[<options>]", and not "[options]" or other?
Message-ID: <alpine.LFD.2.21.1805240738260.6091@localhost.localdomain>
URL: https://gitlist.dev/e/alpine.LFD.2.21.1805240738260.6091%40localhost.localdomain

```

  more pedantry -- was digging through "man git-diff" and noticed the
inconsistency in how options are represented. first, in the synopsis,
you see "[options]":

  SYNOPSIS
    git diff [options] [<commit>] [--] [<path>...]
    git diff [options] --cached [<commit>] [--] [<path>...]
    git diff [options] <commit> <commit> [--] [<path>...]
    git diff [options] <blob> <blob>
    git diff [options] [--no-index] [--] <path> <path>

while just below that in DESCRIPTION, it's all "[--options]":

  git diff [--options] [--] [<path>...]
           ^^^^^^^^^^^

a further search produced this from RelNotes/2.7.0.txt:

  "A couple of commands still showed "[options]" in their usage string
   to note where options should come on their command line, but we
   spell that "[<options>]" in most places these days."

so, "git diff -h" does in fact use the allegedly encouraged syntax:

  $ git diff -h
  usage: git diff [<options>] [<commit> [<commit>]] [--] [<path>...]
  $

but should the man pages be updated similarly? i can whip up a patch
for that unless someone wants to comment on this further.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                  http://crashcourse.ca/dokuwiki

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

```

## Stefan Beller, 2018-05-24 19:15

Subject: Re: is the standard "[<options>]", and not "[options]" or other?
Message-ID: <CAGZ79kbFFPMrQZLcupbp1VUk3U-ww2kV707u-ugRKzYgq5A1BA@mail.gmail.com>
URL: https://gitlist.dev/e/CAGZ79kbFFPMrQZLcupbp1VUk3U-ww2kV707u-ugRKzYgq5A1BA%40mail.gmail.com
In-Reply-To: <alpine.LFD.2.21.1805240738260.6091@localhost.localdomain>

```
On Thu, May 24, 2018 at 4:45 AM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:

>
> but should the man pages be updated similarly? i can whip up a patch
> for that unless someone wants to comment on this further.

Yes, please!

I think [<options>] are the best, as they are pedantically correct.
[--options] is the worst, as there is not such thing as --options.

Thanks,
Stefan

```
