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

Re: [PATCH v2] api-parse-options.txt: document OPT_CMDMODE()

From
Pranit Bauva <pranit.bauva@gmail.com>
Date
Mar 25, 2016, 19:08 UTC
Message-ID
<CAFZEwPOaqZmE4oUy7PWDNv_Qvz+hPgZH2YO6VKk5XUtGYL-ziQ@mail.gmail.com>
In-Reply-To
<01020153af24cfbc-a145ad2b-0cc2-4378-bce9-6b1f68251ce8-000000@eu-west-1.amazonses.com>

I have used bits from your email. I forgot to add "Helped-by: Junio C Hamano <gitster@pobox.com>" . Could you squash it in?

On Sat, Mar 26, 2016 at 12:28 AM, Pranit Bauva <pranit.bauva@gmail.com> wrote:
Show 34 quoted lines
> OPT_CMDMODE mechanism was introduced in the release of 1.8.5 to actively
> notice when multiple "operation mode" options that specify mutually
> incompatible operation modes are given.
>
> Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
> ---
>  Documentation/technical/api-parse-options.txt | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/Documentation/technical/api-parse-options.txt b/Documentation/technical/api-parse-options.txt
> index 5f0757d..695bd4b 100644
> --- a/Documentation/technical/api-parse-options.txt
> +++ b/Documentation/technical/api-parse-options.txt
> @@ -231,6 +231,13 @@ There are some macros to easily define options:
>         pass the command-line option, which can be specified multiple times,
>         to another command.
>
> +`OPT_CMDMODE(short, long, &int_var, description, enum_val)`::
> +       Define an "operation mode" option, only one of which in the same
> +       group of "operating mode" options that share the same `int_var`
> +       can be given by the user. `enum_val` is set to `int_var` when the
> +       option is used, but an error is reported if other "operating mode"
> +       option has already set its value to the same `int_var`.
> +
>
>  The last element of the array must be `OPT_END()`.
>
>
> --
> https://github.com/git/git/pull/219
> --
> 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
Previous: Pranit BauvaNext: Junio C Hamano
Message 7 of 9 in “api-parse-options.txt: document OPT_CMDMODE()”
  1. api-parse-options.txt: document OPT_CMDMODE()Pranit Bauva, Mar 24, 2016
  2. Junio C HamanoMar 24, 2016
  3. Pranit BauvaMar 24, 2016
  4. Junio C HamanoMar 24, 2016
  5. Pranit BauvaMar 24, 2016
  6. api-parse-options.txt: document OPT_CMDMODE()Pranit Bauva, Mar 25, 2016
  7. Pranit BauvaMar 25, 2016
  8. Junio C HamanoMar 25, 2016
  9. api-parse-options.txt: document OPT_CMDMODE()Pranit Bauva, Mar 25, 2016

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.