>>44-45
Fixed.
/* Copyright (c) 2009
>>42
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this
software must display the following acknowledgement:
For God so loved the world, that he gave his only begotten Son,
that whosoever believeth in him should not perish, but have everlasting
life. (John 3:16, King James Bible)
4. Neither the name "Jesux" nor the names of its developers may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#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;
}