Started rewriting kiwmi in non-lit-C

This commit is contained in:
buffet 2018-10-16 21:55:28 +02:00
parent c3288cfa9a
commit ce21043d64

33
src/kiwmi/main.c Normal file
View file

@ -0,0 +1,33 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
#include <limits.h>
#include "common.h"
int
main(int argc, char *argv[])
{
char config_path[PATH_MAX];
int option;
config_path[0] = '\0';
while ((option = getopt(argc, argv, "hvc:")) != -1) {
switch (option) {
case 'h':
printf("Usage: %s [-h|-v|-c <config_path>]\n", argv0);
exit(EXIT_SUCCESS);
break;
case 'v':
printf("v" VERSION_STRING "\n");
exit(EXIT_SUCCESS);
break;
case 'c':
strncpy(config_path, optarg, sizeof(config_path));
break;
}
}
}