bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC] New --encode-path option of global(1)


From: Shigio YAMAGUCHI
Subject: [RFC] New --encode-path option of global(1)
Date: Mon, 26 Apr 2010 19:56:27 +0900

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 <address@hidden>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]