aboutsummaryrefslogtreecommitdiffstats
path: root/contacts.c.in
blob: 024b94e7d10b6b86c4389a611f736441e570736d (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
/* See LICENSE file for copyright and license details. */
#include <stdio.h>
#include <string.h>

#define X(DASH, UNDERSCORE) int main__##UNDERSCORE(int, char *[]);
LIST_COMMANDS
#undef X

char *argv0 = NULL;

int
main(int argc, char *argv[])
{
	const char *name;

      	name = strrchr(*argv, '/');
	if (!name++)
		name = *argv;

#define X(DASH, UNDERSCORE)\
	if (!strcmp(name, #DASH))\
		return main__##UNDERSCORE(argc, argv);
	LIST_COMMANDS;
#undef X

        fprintf(stderr, "%s: unrecognised command for multicall binary\n", *argv);
	return 127;
}