X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/41d7a5f24d5e69bdf6ce10c012d50b89ce1e3957..9ca7f077a0a5ecdd00c5945c7a7bd3cf46e23c13:/src/getargs.c diff --git a/src/getargs.c b/src/getargs.c index 4e095eb2..c030db80 100644 --- a/src/getargs.c +++ b/src/getargs.c @@ -21,6 +21,7 @@ #include #include "system.h" #include "revision.h" +#include "output.h" #include #include @@ -58,9 +59,6 @@ bool error_verbose = false; bool nondeterministic_parser = false; bool glr_parser = false; -bool pull_parser = true; -bool pure_parser = false; -bool push_parser = false; int report_flag = report_none; int trace_flag = trace_none; @@ -263,7 +261,9 @@ Operation modes:\n\ -h, --help display this help and exit\n\ -V, --version output version information and exit\n\ --print-localedir output directory containing locale-dependent data\n\ + --print-datadir output directory containing skeletons and XSLT\n\ -y, --yacc emulate POSIX Yacc\n\ + -W, --warnings=[CATEGORY] report the warnings falling in CATEGORY\n\ \n\ "), stdout); @@ -280,13 +280,25 @@ Parser:\n\ fputs (_("\ Output:\n\ - -d, --defines also produce a header file\n\ + -d, --defines[=FILE] also produce a header file\n\ -r, --report=THINGS also produce details on the automaton\n\ + --report-file=FILE write report to FILE\n\ -v, --verbose same as `--report=state'\n\ -b, --file-prefix=PREFIX specify a PREFIX for output files\n\ -o, --output=FILE leave output to FILE\n\ - -g, --graph also output a graph of the automaton\n\ - -x, --xml also output an xml of the automaton\n\ + -g, --graph[=FILE] also output a graph of the automaton\n\ + -x, --xml[=FILE] also output an XML report of the automaton\n\ +\n\ +"), stdout); + + fputs (_("\ +Warning categories include:\n\ + `midrule-values' unset or unused midrule values\n\ + `yacc' incompatibilities with POSIX YACC\n\ + `all' all the warnings\n\ + `no-CATEGORY' turn off warnings in CATEGORY\n\ + `none' turn off all the warnings\n\ + `error' treat warnings as errors\n\ \n\ "), stdout); @@ -323,7 +335,8 @@ version (void) putc ('\n', stdout); fprintf (stdout, - _("Copyright (C) %d Free Software Foundation, Inc.\n"), 2006); + _("Copyright (C) %d Free Software Foundation, Inc.\n"), + PACKAGE_COPYRIGHT_YEAR); fputs (_("\ This is free software; see the source for copying conditions. There is NO\n\ @@ -395,7 +408,9 @@ static char const short_options[] = "yvegxdhr:L:ltknVo:b:p:S:T::W"; enum { LOCATIONS_OPTION = CHAR_MAX + 1, - PRINT_LOCALEDIR_OPTION + PRINT_LOCALEDIR_OPTION, + PRINT_DATADIR_OPTION, + REPORT_FILE_OPTION }; static struct option const long_options[] = @@ -404,6 +419,7 @@ static struct option const long_options[] = { "help", no_argument, 0, 'h' }, { "version", no_argument, 0, 'V' }, { "print-localedir", no_argument, 0, PRINT_LOCALEDIR_OPTION }, + { "print-datadir", no_argument, 0, PRINT_DATADIR_OPTION }, { "warnings", optional_argument, 0, 'W' }, /* Parser. */ @@ -417,6 +433,7 @@ static struct option const long_options[] = { "graph", optional_argument, 0, 'g' }, { "xml", optional_argument, 0, 'x' }, { "report", required_argument, 0, 'r' }, + { "report-file", required_argument, 0, REPORT_FILE_OPTION }, { "verbose", no_argument, 0, 'v' }, /* Hidden. */ @@ -522,6 +539,10 @@ getargs (int argc, char *argv[]) FLAGS_ARGMATCH (report, optarg); break; + case REPORT_FILE_OPTION: + spec_verbose_file = xstrdup (AS_FILE_NAME (optarg)); + break; + case 'T': FLAGS_ARGMATCH (trace, optarg); break; @@ -557,6 +578,10 @@ getargs (int argc, char *argv[]) printf ("%s\n", LOCALEDIR); exit (EXIT_SUCCESS); + case PRINT_DATADIR_OPTION: + printf ("%s\n", compute_pkgdatadir ()); + exit (EXIT_SUCCESS); + default: usage (EXIT_FAILURE); }