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 variable
GTAGS_COMMANDLINE?
[gtags.conf]
:GTAGS_OPTIONS=-c:\ -- default option
:gtags_hook=./gen.sh:\
[./gen.sh] -- hook script
#!/bin/sh
echo $GTAGS_COMMANDLINE -- print effective command line
[command line]
$ gtags -O -- command line option
gtags -c -O -- effective command line (-c + -O)
$ _
The values in GTAGS_COMMANDLINE are separated with a space. So, I would like to
encode real spaces in them with '%20'.
e.g.
File name includes a blank.
'App file' -> App%20file
You 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