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 */ |
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; |
133 |
{"gtagsconf", required_argument, >agsconf, 1}, |
{"gtagsconf", required_argument, >agsconf, 1}, |
134 |
{"gtagslabel", required_argument, >agslabel, 1}, |
{"gtagslabel", required_argument, >agslabel, 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}, |
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; |
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(); |
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) |
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) |
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); |
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)); |
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 */ |