/[global]/global/gtags/gtags.c
ViewVC logotype

Diff of /global/gtags/gtags.c

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

revision 1.95 by shigio, Thu Nov 4 06:31:31 2004 UTC revision 1.96 by shigio, Sat Nov 6 09:25:16 2004 UTC
# Line 73  int cflag;                                     /* compact format */ Line 73  int cflag;                                     /* compact format */
73  int iflag;                                      /* incremental update */  int iflag;                                      /* incremental update */
74  int Iflag;                                      /* make  id-utils index */  int Iflag;                                      /* make  id-utils index */
75  int oflag;                                      /* suppress making GSYMS */  int oflag;                                      /* suppress making GSYMS */
 int Pflag;                                      /* use postgres */  
76  int qflag;                                      /* quiet mode */  int qflag;                                      /* quiet mode */
77  int wflag;                                      /* warning message */  int wflag;                                      /* warning message */
78  int vflag;                                      /* verbose mode */  int vflag;                                      /* verbose mode */
# Line 91  int do_expand; Line 90  int do_expand;
90  int gtagsconf;  int gtagsconf;
91  int gtagslabel;  int gtagslabel;
92  int other_files;  int other_files;
 int info;  
93  int debug;  int debug;
94  int secure_mode;  int secure_mode;
95  char *extra_options;  char *extra_options;
# Line 135  static struct option const long_options[ Line 133  static struct option const long_options[
133          {"gtagsconf", required_argument, &gtagsconf, 1},          {"gtagsconf", required_argument, &gtagsconf, 1},
134          {"gtagslabel", required_argument, &gtagslabel, 1},          {"gtagslabel", required_argument, &gtagslabel, 1},
135          {"idutils", no_argument, NULL, 'I'},          {"idutils", no_argument, NULL, 'I'},
         {"info", required_argument, &info, 1},  
136          {"other", no_argument, &other_files, 1},          {"other", no_argument, &other_files, 1},
         {"postgres", optional_argument, NULL, 'P'},  
137          {"relative", no_argument, &do_relative, 1},          {"relative", no_argument, &do_relative, 1},
138          {"secure", no_argument, &secure_mode, 1},          {"secure", no_argument, &secure_mode, 1},
139          {"sed", required_argument, &do_sed, 1},          {"sed", required_argument, &do_sed, 1},
# Line 208  main(argc, argv) Line 204  main(argc, argv)
204                          p = long_options[option_index].name;                          p = long_options[option_index].name;
205                          if (!strcmp(p, "expand")) {                          if (!strcmp(p, "expand")) {
206                                  settabs(atoi(optarg + 1));                                  settabs(atoi(optarg + 1));
                         } else if (!strcmp(p, "info")) {  
                                 info_string = optarg;  
207                          } else if (!strcmp(p, "config")) {                          } else if (!strcmp(p, "config")) {
208                                  if (optarg)                                  if (optarg)
209                                          info_string = optarg;                                          info_string = optarg;
# Line 242  main(argc, argv) Line 236  main(argc, argv)
236                  case 'o':                  case 'o':
237                          oflag++;                          oflag++;
238                          break;                          break;
                 case 'P':  
                         Pflag++;  
                         /* pass info string to PQconnectdb(3) */  
                         if (optarg)  
                                 gtags_setinfo(optarg);  
                         break;  
239                  case 'q':                  case 'q':
240                          qflag++;                          qflag++;
241                          setquiet();                          setquiet();
# Line 269  main(argc, argv) Line 257  main(argc, argv)
257          }          }
258          if (qflag)          if (qflag)
259                  vflag = 0;                  vflag = 0;
 #ifndef USE_POSTGRES  
         if (Pflag)  
                 die_with_code(2, "The -P option not available. Please configure GLOBAL with --with-postgres and rebuild it.");  
 #endif  
         if (Pflag) {  
                 /* for backward compatibility */  
                 if (info_string)  
                         gtags_setinfo(info_string);  
         }  
260          if (show_version)          if (show_version)
261                  version(NULL, vflag);                  version(NULL, vflag);
262          if (show_help)          if (show_help)
# Line 571  main(argc, argv) Line 550  main(argc, argv)
550                          warning("GTAGS or GPATH not found. -i option ignored.");                          warning("GTAGS or GPATH not found. -i option ignored.");
551                  iflag = 0;                  iflag = 0;
552          }          }
         if (Pflag && iflag) {  
                 if (wflag)  
                         warning("existing tag files are used. -P option ignored.");  
                 Pflag = 0;  
         }  
553          if (!test("d", dbpath))          if (!test("d", dbpath))
554                  die("directory '%s' not found.", dbpath);                  die("directory '%s' not found.", dbpath);
555          if (vflag)          if (vflag)
# Line 895  updatetags(dbpath, root, path, type) Line 869  updatetags(dbpath, root, path, type)
869                                  gflags |= GTAGS_EXTRACTMETHOD;                                  gflags |= GTAGS_EXTRACTMETHOD;
870                          if (debug)                          if (debug)
871                                  gflags |= GTAGS_DEBUG;                                  gflags |= GTAGS_DEBUG;
                         if (Pflag)  
                                 gflags |= GTAGS_POSTGRES;  
872                          gtags_add(gtop, strbuf_value(sb), path, gflags);                          gtags_add(gtop, strbuf_value(sb), path, gflags);
873                  }                  }
874                  gtags_close(gtop);                  gtags_close(gtop);
# Line 954  createtags(dbpath, root, db) Line 926  createtags(dbpath, root, db)
926                  if (cflag == 1)                  if (cflag == 1)
927                          flags |= GTAGS_COMPACT;                          flags |= GTAGS_COMPACT;
928          }          }
         if (Pflag) {  
                 flags |= GTAGS_POSTGRES;  
         }  
929          strbuf_reset(sb);          strbuf_reset(sb);
930          if (vflag > 1 && getconfs(dbname(db), sb))          if (vflag > 1 && getconfs(dbname(db), sb))
931                  fprintf(stderr, " using tag command '%s <path>'.\n", strbuf_value(sb));                  fprintf(stderr, " using tag command '%s <path>'.\n", strbuf_value(sb));
# Line 1000  createtags(dbpath, root, db) Line 969  createtags(dbpath, root, db)
969                          gflags |= GTAGS_EXTRACTMETHOD;                          gflags |= GTAGS_EXTRACTMETHOD;
970                  if (debug)                  if (debug)
971                          gflags |= GTAGS_DEBUG;                          gflags |= GTAGS_DEBUG;
                 if (Pflag)  
                         gflags |= GTAGS_POSTGRES;  
972                  gtags_add(gtop, comline, path, gflags);                  gtags_add(gtop, comline, path, gflags);
973          }          }
974          total = count;                          /* save total count */          total = count;                          /* save total count */

Legend:
Removed from v.1.95  
changed lines
  Added in v.1.96

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