I'd be more interested in "-rC 0" working... Is that supported, too?
This is only used once; I wonder if it is really that more readable having
this as a function in its own right.
Personally, I do not like abbreviations like that. They do not save that
much screen estate (skip_prefix is only 4 characters longer, but much more
readable). Same goes for "cnt" later.
:-P
Would this not be more intuitive as
if (!prefixcmp(arg, "no-")) {
arg += 3;
flags |= OPT_UNSET;
}
rest = skip_prefix(arg, options[i].long_name);
Hm? (Note that I say UNSET, not SHORT... ;-)
Is this really no error? For example, "git log
--decorate-walls-and-roofs" would not fail...
Please indent by the same amount.
How about calling this "usage_with_options()"? With that name I expected
make_usage() to return a strbuf.
I would prefer this as
if (!(flags & OPT_COPY_DASHDASH)) {
optp.argc--;
optp.argv++;
}
While I'm at it: could you use "args" instead of "optp"? It is misleading
both in that it not only contains options (but other arguments, too) as in
that it is not a pointer (the trailing "p" is used as an indicator of that
very often, including git's source code).
In the same vein, OPT_COPY_DASHDASH should be named
PARSE_OPT_KEEP_DASHDASH.
Please lose the curly brackets.
Same here. (And I'd also make sure that the lines are not that long.)
I know that I proposed "BOOLEAN", but actually, you use it more like an
"INCREMENTAL", right?
Other than that: I like it very much.
Ciao,
Dscho
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html