]>
Commit | Line | Data |
---|---|---|
0a43fb22 JS |
1 | /* |
2 | * The Scalar command-line interface. | |
3 | */ | |
4 | ||
5 | #include "cache.h" | |
6 | #include "gettext.h" | |
7 | #include "parse-options.h" | |
8 | ||
9 | static struct { | |
10 | const char *name; | |
11 | int (*fn)(int, const char **); | |
12 | } builtins[] = { | |
13 | { NULL, NULL}, | |
14 | }; | |
15 | ||
16 | int cmd_main(int argc, const char **argv) | |
17 | { | |
18 | struct strbuf scalar_usage = STRBUF_INIT; | |
19 | int i; | |
20 | ||
21 | if (argc > 1) { | |
22 | argv++; | |
23 | argc--; | |
24 | ||
25 | for (i = 0; builtins[i].name; i++) | |
26 | if (!strcmp(builtins[i].name, argv[0])) | |
27 | return !!builtins[i].fn(argc, argv); | |
28 | } | |
29 | ||
30 | strbuf_addstr(&scalar_usage, | |
31 | N_("scalar <command> [<options>]\n\nCommands:\n")); | |
32 | for (i = 0; builtins[i].name; i++) | |
33 | strbuf_addf(&scalar_usage, "\t%s\n", builtins[i].name); | |
34 | ||
35 | usage(scalar_usage.buf); | |
36 | } |