changeset 253:ec292bfbd633

Simpler implementation for tag relative option.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 26 Oct 2019 01:48:21 -0700
parents 56dc6f8e5472
children 52be4cf89810
files autoload/gutentags/ctags.vim plat/unix/update_tags.sh plat/win32/update_tags.cmd
diffstat 3 files changed, 6 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/autoload/gutentags/ctags.vim	Sat Oct 26 01:17:19 2019 -0700
+++ b/autoload/gutentags/ctags.vim	Sat Oct 26 01:48:21 2019 -0700
@@ -170,7 +170,11 @@
         let l:cmd += ['-o', '"' . gutentags#get_res_file('ctags_recursive.options') . '"']
     endif
     if !empty(g:gutentags_ctags_extra_args)
-        let l:cmd += ['-O', shellescape(join(g:gutentags_ctags_extra_args))]
+        let l:extra_args = join(g:gutentags_ctags_extra_args)
+        if l:use_tag_relative_opt
+            let l:extra_args .= " --tag-relative=yes"
+        endif
+        let l:cmd += ['-O', shellescape(l:extra_args)]
     endif
     if !empty(g:gutentags_ctags_post_process_cmd)
         let l:cmd += ['-P', shellescape(g:gutentags_ctags_post_process_cmd)]
@@ -191,9 +195,6 @@
     for exc in g:gutentags_ctags_exclude
         let l:cmd += ['-x', '"' . exc . '"']
     endfor
-    if l:use_tag_relative_opt
-        let l:cmd += ['-r']
-    endif
     if g:gutentags_pause_after_update
         let l:cmd += ['-c']
     endif
--- a/plat/unix/update_tags.sh	Sat Oct 26 01:17:19 2019 -0700
+++ b/plat/unix/update_tags.sh	Sat Oct 26 01:48:21 2019 -0700
@@ -24,7 +24,6 @@
     echo "    -t [file=tags]: The path to the ctags file to update"
     echo "    -p [dir=]:      The path to the project root"
     echo "    -l [file=]:     The path to a log file"
-    echo "    -r              Use tag-relative paths"
     echo "    -L [cmd=]:      The file list command to run"
     echo "    -A:             Specifies that the file list command returns "
     echo "                    absolute paths"
@@ -38,7 +37,7 @@
 }
 
 
-while getopts "h?e:x:t:p:l:L:s:o:O:P:rcA" opt; do
+while getopts "h?e:x:t:p:l:L:s:o:O:P:cA" opt; do
     case $opt in
         h|\?)
             ShowUsage
@@ -74,9 +73,6 @@
         o)
             CTAGS_ARGS="$CTAGS_ARGS --options=$OPTARG"
             ;;
-        r)
-            CTAGS_ARGS="$CTAGS_ARGS --tag-relative=yes"
-            ;;
         O)
             CTAGS_ARGS="$CTAGS_ARGS $OPTARG"
             ;;
--- a/plat/win32/update_tags.cmd	Sat Oct 26 01:17:19 2019 -0700
+++ b/plat/win32/update_tags.cmd	Sat Oct 26 01:48:21 2019 -0700
@@ -66,11 +66,6 @@
     shift
     goto :LoopParseArgs
 )
-if [%1]==[-r] (
-    set CTAGS_ARGS=%CTAGS_ARGS% --tag-relative=yes
-    shift
-    goto :LoopParseArgs
-)
 if [%1]==[-O] (
     set CTAGS_ARGS=%CTAGS_ARGS% %~2
     shift
@@ -186,7 +181,6 @@
 echo    -t [file=tags]: The path to the ctags file to update
 echo    -p [dir=]:      The path to the project root
 echo    -l [log=]:      The log file to output to
-echo    -r              Use tag-relative paths
 echo    -L [cmd=]:      The file list command to run
 echo    -A:             Specifies that the file list command returns
 echo                    absolute paths