git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Robert P. J. Day <rpjday@crashcourse.ca>
Date
May 24, 2018, 11:45 UTC
Message-ID
<alpine.LFD.2.21.1805240738260.6091@localhost.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
========================================================================
Next: Stefan Beller
Message 1 of 2 in “is the standard "[<options>]", and not "[options]" or other?”
  1. Robert P. J. DayMay 24, 2018
  2. Stefan BellerMay 24, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.