Ramkumar Ramachandra <artagnon@xxxxxxxxx> 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. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html