2008-05-20 08:48:54 +02:00
|
|
|
#include "cache.h"
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
if (argc == 3 && !strcmp(argv[1], "normalize_absolute_path")) {
|
2009-01-28 00:07:36 +01:00
|
|
|
char *buf = xmalloc(PATH_MAX + 1);
|
2008-05-20 08:48:54 +02:00
|
|
|
int rv = normalize_absolute_path(buf, argv[2]);
|
|
|
|
assert(strlen(buf) == rv);
|
|
|
|
puts(buf);
|
|
|
|
}
|
|
|
|
|
2008-05-20 08:49:00 +02:00
|
|
|
if (argc >= 2 && !strcmp(argv[1], "make_absolute_path")) {
|
|
|
|
while (argc > 2) {
|
|
|
|
puts(make_absolute_path(argv[2]));
|
|
|
|
argc--;
|
|
|
|
argv++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-05-20 08:49:26 +02:00
|
|
|
if (argc == 4 && !strcmp(argv[1], "longest_ancestor_length")) {
|
|
|
|
int len = longest_ancestor_length(argv[2], argv[3]);
|
|
|
|
printf("%d\n", len);
|
|
|
|
}
|
|
|
|
|
2008-05-20 08:48:54 +02:00
|
|
|
return 0;
|
|
|
|
}
|