#include <getopt.h>
#include <stdio.h>
#include <string.h>
static void
{
char *dir = NULL;
static const struct option opts[] = {
{ "port", required_argument, NULL, 'p' },
{ "help", no_argument, NULL, 'h' },
{ 0, 0, 0, 0 }
};
while ((c = getopt_long(argc, argv, "p:h", opts, &opt_idx)) != -1) {
switch (c) {
case 'p':
port = atoi(optarg);
break;
case 'h':
default:
fprintf(stderr,
"Usage:\n\t%s [-p <port >] <directory>\n", argv[0]);
return;
}
}
dir = argv[optind];
if (!dir) {
fprintf(stderr, "ERROR: missing directory, use -h for help\n");
return;
}
});
fprintf(stderr, "ERROR: Failed to create the server\n");
return;
}
fprintf(stderr, "ERROR: Failed to add directory %s\n", dir);
}
}
static void
{
}