Hmm. Any reason why you didn't just extend on "git rev-parse"?
That command was written exactly to parse a command line. This is really
cheesy, and doesn't really work right (it splits up numbers too), but you
get the idea..
Linus
---
builtin-rev-parse.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c
index 8d78b69..10b62f7 100644
--- a/builtin-rev-parse.c
+++ b/builtin-rev-parse.c
@@ -116,6 +116,17 @@ static int show_flag(const char *arg)
if (!(filter & DO_FLAGS))
return 0;
if (filter & (is_rev_argument(arg) ? DO_REVS : DO_NOREV)) {
+ if (arg[0] == '-' && arg[1] != '-') {
+ char split[3];
+ split[0] = '-';
+ split[2] = 0;
+ while (arg[1]) {
+ split[1] = arg[1];
+ arg++;
+ show(split);
+ }
+ return 1;
+ }
show(arg);
return 1;
}
-
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