Re: [PATCH 3/3] Documentation: make explicit that optional arguments must be stuck

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 18, 2015 at 05:01:50PM +0200, Matthieu Moy wrote:

> The behavior of command-line options with optional arguments is
> documented in gitcli(7), but it is easy for users to miss, and hard for
> the same user to understand why e.g. "git status -u no" does not work.
> 
> Document this explicitly in the documentation of each short option having
> an optional argument: they are the most error prone since there is no '='
> sign between the option and its argument.

I like this. Even though it is redundant, it is getting information to
the place where users can see it, and I don't think it is so large as to
obscure the rest of the content.

> diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
> index dbea6e7..5f0082e 100644
> --- a/Documentation/git-am.txt
> +++ b/Documentation/git-am.txt
> @@ -141,7 +141,8 @@ default.   You can use `--no-utf8` to override this.
>  
>  -S[<keyid>]::
>  --gpg-sign[=<keyid>]::
> -	GPG-sign commits.
> +	GPG-sign commits. The `keyid` argument is optional; if
> +	specified, it must be stuck to the option without a space.

I think this wording is probably OK. At first I thought it was saying
the wrong thing for the long form ("stuck without a space" would mean
"--gpg-sign[keyid]"), but I think the syntax just above makes it pretty
clear.

> diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
> index 335f312..e1e8f57 100644
> --- a/Documentation/git-status.txt
> +++ b/Documentation/git-status.txt
> @@ -53,8 +53,9 @@ OPTIONS
>  --untracked-files[=<mode>]::
>  	Show untracked files.
>  +
> -The mode parameter is optional (defaults to 'all'), and is used to
> -specify the handling of untracked files.
> +The mode parameter is used to specify the handling of untracked files.
> +It is optional: it defaults to 'all', and if specified, it must be
> +stuck to the option (e.g. `-uno`, but not `-u no`).

I think this rearrangement makes the meaning much more clear overall.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]