blob: b297951e09914ec374d49998984ec6c2036ee5f8 (
plain) (
tree)
|
|
/* 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;
}
|