aboutsummaryrefslogtreecommitdiffstats
path: root/sha3sum-mcb.c
blob: 88990ca5ff2306777c156b1edc10d999604412c7 (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
/* See LICENSE file for copyright and license details. */
#include <string.h>
#include <stdio.h>

#include "commands.h"

#define _(NAME, MAIN) int MAIN(int argc, char *argv[]);
LIST_COMMANDS(_)
#undef _

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

	p = strrchr(argv[0], '/');
	p = p ? &p[1] : argv[0];

	#define _(NAME, MAIN)\
		if (!strcmp(p, NAME))\
			return MAIN(argc, argv);
	LIST_COMMANDS(_)
	#undef _

	fprintf(stderr, "%s is a multicall binary and cannot be execute directly\n", argv[0]);
	return 127;
}