aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
blob: 1d97acbcf32eb30088907e455d93a9369d19bff6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <stdio.h>

#include "io/file.h"
#include "cli/args.h"

int main(int argc, char** argv)
{
	struct Args args;

	enum ParseResult result = parse_args(argc, argv, &args);
	if (result == PARSE_EXIT)
		return 0;
	if (result == PARSE_ERROR)
		return 1;

	struct File source;
	if (!read_file(args.input_path, &source))
		return 1;

	printf("read %zu bytes from %s\n", source.size, args.input_path);

	free_file(&source);
	return 0;
}