git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: Git List <git@vger.kernel.org>, Jonathan Nieder <jrnieder@gmail.com>
Subject: Re: [RFC/PATCH] parse-options: introduce parse_subcommands
Date: Wed, 06 Jun 2012 10:26:12 -0700	[thread overview]
Message-ID: <7vobowmjwr.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CALkWK0nuJ2VrAUD5PsfnZzO5yDgB+h4xn8g=CTqmUvJ8DOdPNQ@mail.gmail.com> (Ramkumar Ramachandra's message of "Wed, 6 Jun 2012 19:40:39 +0530")

Ramkumar Ramachandra <artagnon@gmail.com> writes:

>> It looks like a static version of string_list_lookup() and does not
>> have much reason to tie it to "subcommand".
>
> How so?  I can use a string_list to keep subcommand->name and stuff
> the callback into util.  Where do I put subcommand->help then?

A string_list is a mapping from a string to an arbitrary piece of
data; there is nothing that stops you from placing a pointer to a
structure in its util field.

> I agree that there's no reason to tie it to subcommand though.

Yeah, if it were a generic API for a mapping from a string to an
arbitrary piece of data that is determined at compile time, it would
be a useful addition, and at that point, it is misleading to call
that a "parse-subcommand" API.  It is just a look-up mechansim in
a fixed table keyed by strings.

  reply	other threads:[~2012-06-06 17:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-04  9:35 [RFC/PATCH] parse-options: introduce parse_subcommands Ramkumar Ramachandra
2012-06-04 17:01 ` Junio C Hamano
2012-06-06 14:10   ` Ramkumar Ramachandra
2012-06-06 17:26     ` Junio C Hamano [this message]
2012-06-08  8:56       ` [RFC] notes: attach help text to subcommands Ramkumar Ramachandra
2012-06-08 14:49         ` Junio C Hamano
2012-06-08 15:28           ` [PATCH] " Ramkumar Ramachandra
2012-06-08 15:36             ` Jonathan Nieder
2012-06-08 15:54               ` Felipe Contreras
2012-06-08 16:34                 ` Ramkumar Ramachandra
2012-06-13 15:04                   ` Felipe Contreras
2012-06-08 17:03             ` Junio C Hamano
2012-06-05 23:32 ` [RFC/PATCH] parse-options: introduce parse_subcommands Jonathan Nieder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vobowmjwr.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).