]> git.ozlabs.org Git - ccan/blob - tools/ccan_depends.c
commiting ccan web pages
[ccan] / tools / ccan_depends.c
1 #include "tools.h"
2 #include <err.h>
3 #include <stdlib.h>
4 #include <stdio.h>
5 #include "string/string.h"
6 #include "talloc/talloc.h"
7
8 int main(int argc, char *argv[])
9 {
10         char **deps;
11         unsigned int i;
12
13         if (argc != 2)
14                 errx(1, "Usage: ccan_depends <dir>\n"
15                         "Spits out all the ccan dependencies (recursively)");
16
17         deps = get_deps(talloc_autofree_context(), argv[1]);
18         for (i = 0; deps[i]; i++)
19                 if (strstarts(deps[i], "ccan/"))
20                         printf("%s\n", deps[i]);
21         return 0;
22 }