blob: b297951e09914ec374d49998984ec6c2036ee5f8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
/* See LICENSE file for copyright and license details. */
#include <stdio.h>
#include <string.h>
#define X(NAM) int main__##NAM(int, char *[]);
LIST_COMMANDS
#undef X
char *argv0 = NULL;
int
main(int argc, char *argv[])
{
char *name, *p;
name = strrchr(*argv, '/');
if (!name++)
name = *argv;
for (p = name; (p = strchr(p, '-'));)
*p++ = '_';
#define X(NAM)\
if (!strcmp(name, #NAM))\
return main__##NAM(argc, argv);
LIST_COMMANDS;
#undef X
fprintf(stderr, "%s: unrecognised command for multicall binary\n", *argv);
return 127;
}
|