|
From: | Marcus Harnisch |
Subject: | Re: Feature request: file list |
Date: | Tue, 18 Oct 2016 11:21:39 +0200 |
Hi,> However, I am not entirely happy from a usability perspective.> In particular it would be helpful to have the hook know about all active> command line options, even those passed in by GTAGS_OPTIONS (e.g. for> determining the -f parameter). This doesn't seem possible at the moment,> as the hook script is executed rather early, before options processing> has started. Perhaps GTAGS_OPTIONS should be set to the effective list> of options by gtags before calling the hook.How about storing effective command line to new environment variableGTAGS_COMMANDLINE?[gtags.conf]:GTAGS_OPTIONS=-c:\ -- default option:gtags_hook=./gen.sh:\[./gen.sh] -- hook script#!/bin/shecho $GTAGS_COMMANDLINE -- print effective command line[command line]$ gtags -O -- command line optiongtags -c -O -- effective command line (-c + -O)$ _The values in GTAGS_COMMANDLINE are separated with a space. So, I would like toencode real spaces in them with '%20'.e.g.File name includes a blank.'App file' -> App%20fileYou can decode it like this:$ echo 'App%20file' | sed 's/%20/ /g'What do you think?> Another, losely related, issue popped up in testing this: When I make an effort> to provide a list of files to scan (rather than gtags searching the directory),> then a user could expect that this list not further mangled with. While the skip> interaction is documented under ‘skip’, I think this asell as the --accept-dotfiles> option deserve to be mentioned in the ‘gtags.files’ description.Certainly the relationship between them has not been described in the document.I will add such a document. Please wait a little.Regards,Shigio--2016-10-15 6:38 GMT+09:00 Marcus Harnisch <address@hidden>:Another, losely related, issue popped up in testing this: When I make an effort to provide a list of files to scan (rather than gtags searching the directory), then a user could expect that this list not further mangled with. While the skip interaction is documented under ‘skip’, I think this as well as the --accept-dotfiles option deserve to be mentioned in the ‘gtags.files’ description.However, I am not entirely happy from a usability perspective. In particular it would be helpful to have the hook know about all active command line options, even those passed in by GTAGS_OPTIONS (e.g. for determining the -f parameter). This doesn't seem possible at the moment, as the hook script is executed rather early, before options processing has started. Perhaps GTAGS_OPTIONS should be set to the effective list of options by gtags before calling the hook.Hi ShigioI played with the gtags_hook and managed to generate a file list with the help of rsync(1), so I can take full advantage of the powerful syntax of its --exclude-from option. This works quite well as a proof-of concept generic hook script, that could be installed systemwide.Many thanksMarcusShigio YAMAGUCHI <address@hidden>PGP fingerprint: D1CB 0B89 B346 4AB6 5663 C4B6 3CA5 BBB3 57BE DDA3
[Prev in Thread] | Current Thread | [Next in Thread] |