/[bison]/bison/src/getargs.c
ViewVC logotype

Diff of /bison/src/getargs.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.24 by akim, Mon Aug 6 09:22:33 2001 UTC revision 1.25 by pascal, Thu Sep 20 18:32:20 2001 UTC
# Line 24  Line 24 
24  #include "files.h"  #include "files.h"
25  #include "complain.h"  #include "complain.h"
26  #include "getargs.h"  #include "getargs.h"
27    #include "xalloc.h"
28    #include "options.h"
29    
30  int debug_flag = 0;  int debug_flag = 0;
31  int defines_flag = 0;  int defines_flag = 0;
# Line 39  int graph_flag = 0; Line 41  int graph_flag = 0;
41  const char *skeleton = NULL;  const char *skeleton = NULL;
42    
43  extern char *program_name;  extern char *program_name;
 const char *shortopts = "yvgdhrltknVo:b:p:S:";  
 static struct option longopts[] =  
 {  
   /* Operation modes. */  
   {"help",              no_argument,    0, 'h'},  
   {"version",           no_argument,    0, 'V'},  
   {"yacc",              no_argument,    0, 'y'},  
   {"fixed-output-files",no_argument,    0, 'y'},  
   
   /* Parser. */  
   {"skeleton",          required_argument,      0, 'S'},  
   {"debug",             no_argument,            0, 'd'},  
   {"locations",         no_argument,    &locations_flag, 1},  
   /* was 'a';  apparently unused -wjh */  
   {"name-prefix",       required_argument,      0, 'p'},  
   {"no-lines",          no_argument,            0, 'l'},  
   {"no-parser",         no_argument,            0, 'n'},  
   {"raw",               no_argument,            0, 'r'},  
   {"token-table",       no_argument,            0, 'k'},  
   
   /* Output. */  
   {"defines",           no_argument,            0, 'd'},  
   {"verbose",           no_argument,            0, 'v'},  
   {"file-prefix",       required_argument,      0, 'b'},  
   {"output-file",       required_argument,      0, 'o'},  
   {"graph",             no_argument,            0, 'g'},  
   
   /* Hidden. */  
   {"statistics",        no_argument,    &statistics_flag, 1},  
   {0, 0, 0, 0}  
 };  
44    
45  /*---------------------------.  /*---------------------------.
46  | Display the help message.  |  | Display the help message.  |
# Line 161  getargs (int argc, char *argv[]) Line 132  getargs (int argc, char *argv[])
132  {  {
133    int c;    int c;
134    
135      create_long_option_table ();
136    while ((c = getopt_long (argc, argv, shortopts, longopts, NULL)) != EOF)    while ((c = getopt_long (argc, argv, shortopts, longopts, NULL)) != EOF)
137      switch (c)      switch (c)
138        {        {
# Line 234  getargs (int argc, char *argv[]) Line 206  getargs (int argc, char *argv[])
206          exit (1);          exit (1);
207        }        }
208    
209      XFREE (longopts);
210    if (optind == argc)    if (optind == argc)
211      {      {
212        fprintf (stderr, _("%s: no grammar file given\n"), program_name);        fprintf (stderr, _("%s: no grammar file given\n"), program_name);

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26