Thank you. I understood. > Is there some easy way to extract this information directly from the DB?
Since Global is a line oriented tool like grep(1), its DB don't have column information. > What I’d like to see is an output like this: > > $ machine-readable-global -r arg > 6:8,13 > 6:15,20 So, you have to write a program to know column information. [global's output] arg 6 multiple-users.c func(arg(), arg()); [program] pattern = "\\barg\\b" // \\b matches to a word boundary line = read a line at 6 in multiple-users.c. regex_t reg; regmatch_t m[100]; regcomp(®, pattern, ...); regexec(®, line, 100, &m, ...); As the result, the 'm' array has column information. Regards Shigio 2015-08-21 0:18 GMT+09:00 Jonas H. <jo...@lophus.org>: > > > On 20 Aug 2015, at 15:23, Shigio YAMAGUCHI <shi...@gnu.org> wrote: > > > > I don't know that meaning well. > > Could you please explain it by example? > > int arg() { return 42; } > > void func(int x) { } > > int main() { > func(arg(), arg()); > } > > $ global -r -x arg > arg 6 multiple-users.c func(arg(), arg()); > > OK so this actually even worse for script usage than expected: > > * The usage of `arg` is displayed only once > * The code context shown doesn’t start at the place/column `arg` is used > but somewhere else > > What I’d like to see is an output like this: > > $ machine-readable-global -r arg > 6:8,13 > 6:15,20 > > These are the line, start and end column numbers. > > Is there some easy way to extract this information directly from the DB? > > Thanks > Jonas > _______________________________________________ > Help-global mailing list > Help-global@gnu.org > https://lists.gnu.org/mailman/listinfo/help-global > -- Shigio YAMAGUCHI <shi...@gnu.org> PGP fingerprint: D1CB 0B89 B346 4AB6 5663 C4B6 3CA5 BBB3 57BE DDA3
_______________________________________________ Help-global mailing list Help-global@gnu.org https://lists.gnu.org/mailman/listinfo/help-global