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

Re: [PATCH] parse-options: fix the description of defval

From
Ivan Ukhov <ivan.ukhov@gmail.com>
Date
Mar 29, 2015, 13:45 UTC
Message-ID
<4999FA4A-6409-41F1-9791-F74114EB4BB8@gmail.com>
In-Reply-To
<CACRoPnQFBbhH0oKDON+nwHO_MiB_ZjiQQU1Wdsu7kVaqAEk=pA@mail.gmail.com>
Hello Paul,
Yes, you are right. Thank you for the clarification!

Regards, Ivan

Show 20 quoted lines
> On Mar 29, 2015, at 3:27 PM, Paul Tan <pyokagan@gmail.com> wrote:
> 
> Hi,
> 
> On Sun, Mar 29, 2015 at 5:28 PM, Ivan Ukhov <ivan.ukhov@gmail.com> wrote:
>> I have checked the definitions of the three macros you mentioned, and it seems that none of them uses defval to store pointers. OPTION_CMDMODE stores chars and integers. OPTION_STRING does not use defval at all (pointers go in a different field of the option struct), and the same applies to OPTION_FILENAME. I am probably missing something; can you please clarify what you mean? Thank you.
> 
> For OPTION_STRING, if the PARSE_OPT_OPTARG flag is set (as the
> documentation already states), the option can be provided on the
> command line without any corresponding argument. If provided as so,
> the string pointer of defval is used.
> 
> See get_value() in parse-options.c
> 
> I haven't used the other option types before yet (just did a grep
> 'defval' in parse-options.c) so I don't know what they do with defval.
> That's why it would be nice if they were documented :-)
> 
> Regards,
> Paul
Previous: Paul TanNext: Junio C Hamano
Message 5 of 8 in “parse-options: fix the description of defval”
  1. parse-options: fix the description of defvalIvan Ukhov, Mar 29, 2015
  2. Paul TanMar 29, 2015
  3. Ivan UkhovMar 29, 2015
  4. Paul TanMar 29, 2015
  5. Ivan UkhovMar 29, 2015
  6. Junio C HamanoMar 29, 2015
  7. Ivan UkhovMar 29, 2015
  8. Junio C HamanoMar 29, 2015

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.