# [RFC] Documentation: --options in man-pages synopsys

4 messages from 2013-10-08 to 2013-10-10. Participants: Dmitry Ivankov, Loyall, David, Philip Oakley, Jeff King.
Thread: https://gitlist.dev/t/35081

## Dmitry Ivankov, 2013-10-08 12:07

Subject: [RFC] Documentation: --options in man-pages synopsys
Message-ID: <CA+gfSn-o7cH3a-KWx_iggNc4-rYzQysbTj7OGdaggutLu-X-BA@mail.gmail.com>
URL: https://gitlist.dev/e/CA%2BgfSn-o7cH3a-KWx_iggNc4-rYzQysbTj7OGdaggutLu-X-BA%40mail.gmail.com

```
Hi,

I've noticed that man git-pack-objects describes cmdline as following

SYNOPSYS
'git pack-objects' [-q | --progress | --all-progress] [--all-progress-implied]
[--no-reuse-delta] [--delta-base-offset] [--non-empty]
[--local] [--incremental] [--window=<n>] [--depth=<n>]
[--revs [--unpacked | --all]] [--stdout | base-name]
[--keep-true-parents] < object-list

while OPTIONS sections has even more options, --no-reuse-objects for instance.

Should it be dealt with and how?
- add smth like ... at the tail of options in synopsys to indicate
that there are more options
- add all the [--options] to synopsys
- drop all the [--options] as they all are optional
- pick only the most common/important ones like -q --progress, per
command or per command classes (hard to maintain and/or verify?)

```

## Loyall, David, 2013-10-08 14:03

Subject: RE: [RFC] Documentation: --options in man-pages synopsys
Message-ID: <FCEE4469EE8B234199968ECA9B0661E230EC61C0@STNEEX10MB01.stone.ne.gov>
URL: https://gitlist.dev/e/FCEE4469EE8B234199968ECA9B0661E230EC61C0%40STNEEX10MB01.stone.ne.gov
In-Reply-To: <CA+gfSn-o7cH3a-KWx_iggNc4-rYzQysbTj7OGdaggutLu-X-BA@mail.gmail.com>

```
As a unix user I'd expect the SYNOPSIS section at the top of the man page to include all options that the command accepts.  Mutually exclusive options are expected to be in the form [-q | --progress | --all-progress], such is already done.

I believe that you'd be safe in following http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html unless the git-* family of commands and documentation deviate from it in a way that I am not aware of.

Hope this helps,
--Dave

> -----Original Message-----
> From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On
> Behalf Of Dmitry Ivankov
> Sent: Tuesday, October 08, 2013 7:07 AM
> To: Git List
> Subject: [RFC] Documentation: --options in man-pages synopsys
> 
> Hi,
> 
> I've noticed that man git-pack-objects describes cmdline as following
> 
> SYNOPSYS
> 'git pack-objects' [-q | --progress | --all-progress] [--all-progress-implied] [--
> no-reuse-delta] [--delta-base-offset] [--non-empty] [--local] [--incremental]
> [--window=<n>] [--depth=<n>] [--revs [--unpacked | --all]] [--stdout | base-
> name] [--keep-true-parents] < object-list
> 
> while OPTIONS sections has even more options, --no-reuse-objects for
> instance.
> 
> Should it be dealt with and how?
> - add smth like ... at the tail of options in synopsys to indicate that there are
> more options
> - add all the [--options] to synopsys
> - drop all the [--options] as they all are optional
> - pick only the most common/important ones like -q --progress, per
> command or per command classes (hard to maintain and/or verify?)
> --
> To unsubscribe from this list: send the line "unsubscribe git" in the body of a
> message to majordomo@vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html

```

## Philip Oakley, 2013-10-09 22:35

Subject: Re: [RFC] Documentation: --options in man-pages synopsys
Message-ID: <AB54BA13FC634F47B15CFE796CECADC4@PhilipOakley>
URL: https://gitlist.dev/e/AB54BA13FC634F47B15CFE796CECADC4%40PhilipOakley
In-Reply-To: <FCEE4469EE8B234199968ECA9B0661E230EC61C0@STNEEX10MB01.stone.ne.gov>

```
From: "Loyall, David" <david.loyall@nebraska.gov>
Sent: Tuesday, October 08, 2013 3:03 PM
> As a unix user I'd expect the SYNOPSIS section at the top of the man 
> page to include all options that the command accepts.  Mutually 
> exclusive options are expected to be in the form [-q | --progress 
> | --all-progress], such is already done.
>
> I believe that you'd be safe in following 
> http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html 
> unless the git-* family of commands and documentation deviate from it 
> in a way that I am not aware of.


For an example of a command with a long list of options try `git 
rev-parse --help`.

SYNOPSIS
    git rev-parse [ --option ] <args>.

Philip

>
> Hope this helps,
> --Dave
>
>> -----Original Message-----
>> From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On
>> Behalf Of Dmitry Ivankov
>> Sent: Tuesday, October 08, 2013 7:07 AM
>> To: Git List
>> Subject: [RFC] Documentation: --options in man-pages synopsys
>>
>> Hi,
>>
>> I've noticed that man git-pack-objects describes cmdline as following
>>
>> SYNOPSYS
>> 'git pack-objects' [-q | --progress | --all-progress] 
>> [--all-progress-implied] [--
>> no-reuse-delta] [--delta-base-offset] [--non-empty] [--local] 
>> [--incremental]
>> [--window=<n>] [--depth=<n>] [--revs [--unpacked | --all]] [--stdout 
>> | base-
>> name] [--keep-true-parents] < object-list
>>
>> while OPTIONS sections has even more options, --no-reuse-objects for
>> instance.
>>
>> Should it be dealt with and how?
>> - add smth like ... at the tail of options in synopsys to indicate 
>> that there are
>> more options
>> - add all the [--options] to synopsys
>> - drop all the [--options] as they all are optional
>> - pick only the most common/important ones like -q --progress, per
>> command or per command classes (hard to maintain and/or verify?)
>> --
>> To unsubscribe from this list: send the line "unsubscribe git" in the 
>> body of a
>> message to majordomo@vger.kernel.org More majordomo info at
>> http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

```

## Jeff King, 2013-10-10 01:52

Subject: Re: [RFC] Documentation: --options in man-pages synopsys
Message-ID: <20131010015255.GB15106@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20131010015255.GB15106%40sigill.intra.peff.net
In-Reply-To: <AB54BA13FC634F47B15CFE796CECADC4@PhilipOakley>

```
On Wed, Oct 09, 2013 at 11:35:19PM +0100, Philip Oakley wrote:

> >As a unix user I'd expect the SYNOPSIS section at the top of the
> >man page to include all options that the command accepts.  Mutually
> >exclusive options are expected to be in the form [-q | --progress |
> >--all-progress], such is already done.
> >
> >I believe that you'd be safe in following http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html
> >unless the git-* family of commands and documentation deviate from
> >it in a way that I am not aware of.
> 
> 
> For an example of a command with a long list of options try `git
> rev-parse --help`.
> 
> SYNOPSIS
>    git rev-parse [ --option ] <args>.

The current documentation is quite inconsistent between the two forms.
Personally, I favor the shorter form as I think the longer ones end up
quite unwieldy (see "git help rev-list" for example). But I do think the
synopsis should show the major modes of the command. You can see
examples of both in the GNU pages for "cat" and "sort":

  $ man cat | sed -n '/SYNOPSIS/,${p; /^$/q}'
  SYNOPSIS
         cat [OPTION]... [FILE]...

  $ man sort | sed -n '/SYNOPSIS/,${p; /^$/q}'
  SYNOPSIS
         sort [OPTION]... [FILE]...
         sort [OPTION]... --files0-from=F

A similar example in git would be "git help branch", whose synopsis
should include listing mode, creation mode, deleting mode, etc.

However, I am not sure everyone on the list agrees with me on this. Last
time it came up (which was probably several years now) there was some
discussion but not enough consensus for somebody to actually go through
and standardize it.

-Peff

```
