Code

test-path-utils: Add subcommand "absolute_path"
authorMichael Haggerty <mhagger@alum.mit.edu>
Thu, 4 Aug 2011 04:47:47 +0000 (06:47 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 4 Aug 2011 22:57:18 +0000 (15:57 -0700)
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
test-path-utils.c

index e7671593df6bf014f3a9d8bd5173d1edcfd6545b..a410e3026f6cd26f40bebe903d6d1d69350cfd7b 100644 (file)
@@ -20,6 +20,15 @@ int main(int argc, char **argv)
                return 0;
        }
 
+       if (argc >= 2 && !strcmp(argv[1], "absolute_path")) {
+               while (argc > 2) {
+                       puts(absolute_path(argv[2]));
+                       argc--;
+                       argv++;
+               }
+               return 0;
+       }
+
        if (argc == 4 && !strcmp(argv[1], "longest_ancestor_length")) {
                int len = longest_ancestor_length(argv[2], argv[3]);
                printf("%d\n", len);