git-pickaxe: allow -Ln,m as well as -L n,m
The command rejects -L1,10 as an invalid line range specifier and I got frustrated enough by it, so this makes it allow both forms of input. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Oct 29, 2006 at 23:50 UTC
2c40f98439e07b8579d0549109a4feed54da9e40
1 file changed
+8
-2
builtin-pickaxe.c
+8
-2
@@ -1429,9 +1429,15 @@ int cmd_pickaxe(int argc, const char **argv, const char *prefix)
1429
opt |= PICKAXE_BLAME_COPY | PICKAXE_BLAME_MOVE;
1430
blame_copy_score = parse_score(arg+2);
1431
}
1432
- else if (!strcmp("-L", arg) && ++i < argc) {
1432
+ else if (!strncmp("-L", arg, 2)) {
1433
char *term;
1434
- arg = argv[i];
1434
+ if (!arg[2]) {
1435
+ if (++i >= argc)
1436
+ usage(pickaxe_usage);
1437
+ arg = argv[i];
1438
+ }
1439
+ else
1440
+ arg += 2;
1441
if (bottom || top)
1442
die("More than one '-L n,m' option given");
1443
bottom = strtol(arg, &term, 10);