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

Re: [RFC/PATCH] parse-options: introduce parse_subcommands

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jun 5, 2012, 23:32 UTC
Message-ID
<20120605233257.GG3619@burratino>
In-Reply-To
<1338802534-32394-1-git-send-email-artagnon@gmail.com>
Hi,
Ramkumar Ramachandra wrote:
Show 5 quoted lines
>   $ git notes foo
>   error: Unknown subcommand: foo
>   usage: git notes [--ref <notes_ref>] [list [<object>]]
>      or: git notes [--ref <notes_ref>] add [-f] [-m <msg> | -F <file> | (-c | -C) <object>] [<object>]
>      or: git notes [--ref <notes_ref>] copy [-f] <from-object> <to-object>
[...]
Show 17 quoted lines
> is replaced by a more helpful:
>
>   $ git notes foo
>   error: unknown subcommand: foo
>   usage: git notes [<options>] [<subcommand>] [<options>] [<object>..]
>
>   available subcommands:
>       list                  list notes for given object
>       add                   add notes for given object
>       copy                  copy notes for first object onto second object
>       append                append notes to existing object
>       edit                  edit notes for given object
>       show                  show notes for given object
>       merge                 merge given notes ref into current notes ref
>       remove                remove notes for given objects
>       prune                 remove all notes for non-existing/unreachable objects
>       get-ref               print the current notes ref
The goal looks good.  As Junio said, the code looks simplifiable.

Hope that helps, Jonathan

Previous: Junio C Hamano
Message 13 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.