#include "config.h" #include #include #ifdef HAVE_LIBGEN_H # include #endif /* HAVE_LIBGEN_H */ #include static const char *prg_name; static void usage(int retcode) { if (retcode == EXIT_FAILURE) { fprintf(stderr, "Try '%s -h' for more information.\n", prg_name); } else { printf("Usage: %s [-hV] [-b bios]\n", prg_name); printf("\t-h\tdisplay this help and exit\n"); printf("\t-V\toutput version information\n"); printf("\nReport bugs to <%s>\n", PACKAGE_BUGREPORT); } exit(retcode); } static void version(void) { printf("%S version %s\n", PACKAGE_NAME, PACKAGE_VERSION); exit(EXIT_SUCCESS); } int main(int argc, char **argv) { #ifdef HAVE_LIBGEN_H prg_name = basename(argv[0]); #else prg_name = argv[0]; #endif /* HAVE_LIBGEN_H */ while ((argc > 1) && (argv[1][0] == '-')) { switch (argv[1][1]) { case 'h': usage(EXIT_SUCCESS); break; case 'V': version(); break; default: usage(EXIT_FAILURE); break; } argv++; argc--; } return (EXIT_SUCCESS); }