Name: Anonymous 2009-05-06 2:50
/PROG/ has decided to worktogether to make a telnet based multiplayerp
/* TODO: Insert GNU GPL version 3 header. */
#include "config.h"
/* FUCK THE ESTABLISHMENT, YEAH, STICK IT TO THE MAN !! */
#define _GNU_SOURCE
#include <stdio.h>
#include <errno.h>
#include <getopt.h>
static void
print_help()
{
printf("Usage: %s [OPTION]\n", program_invocation_short_name);
puts("OPTION can be:");
puts(" --help Display help.");
puts(" --version Display version information.");
}
static void
print_version()
{
puts("This is " PACKAGE_NAME " version " PACKAGE_VERSION ".");
}
int
main(int argc, char* argv[])
{
for (;;) {
static const struct long_options[] = {
{ "help", 0, NULL, 'h' },
{ "version", 0, NULL, 'v' },
{ 0, 0, 0, 0 }
};
int option_index = 0;
int c = getopt_long(argc, argv, "hv", long_options, &option_index);
if (c == -1)
break;
switch (c) {
case 'h':
print_help();
return EXIT_SUCCESS;
case 'v':
print_version();
return EXIT_SUCCESS;
default:
print_help();
return EXIT_FAILURE;
}
}
if (optind < argc) {
print_help();
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}