Hi all,
How about adding new option --encode-path to global(1)?
This option is used to correspond to various regulations and customs,
especially to path names which include blanks.
--encode-path=<chars>
In the path name of the output of global(1), the characters specified
in the <chars> is converted into %hex format. For example,
$ global main -x
main 152 main main.c main(int argc, char *argv[])
$ global main -x --encode-path=' '
main 152 main%20main.c main(int argc, char *argv[])
===
'%' itself is always converted into '%25' when this option is specified.
$ global main -x
main 152 main%main.c main(int argc, char *argv[])
$ global main -x --encode-path=' '
main 152 main%25main.c main(int argc, char *argv[])
===
It is easy to treat the output. For example, in Perl language:
($tag, $lno, $path, $image) = split(/\s+/, $_, 4);\
$path =~ s/%([0-9A-Fa-f][0-9A-Fa-f])/pack("C", hex($1))/eg;\
What do you think?
--
Shigio YAMAGUCHI <[email protected]>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663 C4B6 3CA5 BBB3 57BE DDA3
_______________________________________________
Bug-global mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-global