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

Re: [PATCH] notes: attach help text to subcommands

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jun 8, 2012, 16:34 UTC
Message-ID
<CALkWK0k_tP7qGJ9zvAvrPtqMqAtK2QE7mibf2Yt1gssN10a1NA@mail.gmail.com>
In-Reply-To
<CAMP44s28aoKkXyTr4Stow-empen9_CUxAWTDi_gcSUpKjMzg6Q@mail.gmail.com>
Hi Jonathan and Felipe,
Jonathan Nieder wrote:
Show 7 quoted lines
> Ramkumar Ramachandra wrote:
>
>>  Thanks.  I wish we could do something aout USAGE_OPTS_WIDTH and
>>  USAGE_GAP; I stole them from parse-options.
>
> Expose them in parse-options.h?  Or put this functionality in a
> parseopt-related file?
Exposing a `subcommand_usage` in parse-options.h may not be a bad idea.
Felipe Contreras wrote:
Show 6 quoted lines
> There's many commands that would benefit from this. In addition to
> provide a better help for subcommands, this can be used to generate
> automatically the shell completion list of subcommands.
>
> Even more; in zsh it would be possible to show this help text directly
> in the completion.

How exactly is that going to work? `git notes -h` doesn't output this- so the only way to get this output is to invoke `git notes` with an invalid subcommand. To fix that, I'd have to teach parse-options about subcommands.

Ram
Previous: Felipe ContrerasNext: Felipe Contreras
Message 10 of 13 in “parse-options: introduce parse_subcommands”
  1. parse-options: introduce parse_subcommandsRamkumar Ramachandra, Jun 4, 2012
  2. Junio C HamanoJun 4, 2012
  3. Ramkumar RamachandraJun 6, 2012
  4. Junio C HamanoJun 6, 2012
  5. [RFC] notes: attach help text to subcommandsRamkumar Ramachandra, Jun 8, 2012
  6. Junio C HamanoJun 8, 2012
  7. notes: attach help text to subcommandsRamkumar Ramachandra, Jun 8, 2012
  8. Jonathan NiederJun 8, 2012
  9. Felipe ContrerasJun 8, 2012
  10. Ramkumar RamachandraJun 8, 2012
  11. Felipe ContrerasJun 13, 2012
  12. Junio C HamanoJun 8, 2012
  13. Jonathan NiederJun 5, 2012

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.