changeset 16:c11616828595

Add an option to specify a `ctags` options file to be used. Fixed some arguments being forgotten in the Windows script.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 21 Aug 2014 11:32:32 -0700
parents b557282af215
children b73466268844
files plat/unix/update_tags.sh plat/win32/update_tags.cmd plugin/autotags.vim
diffstat 3 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plat/unix/update_tags.sh	Tue Jul 29 16:11:24 2014 -0700
+++ b/plat/unix/update_tags.sh	Thu Aug 21 11:32:32 2014 -0700
@@ -18,6 +18,7 @@
     echo "    -t [file=tags]: The path to the ctags file to update"
     echo "    -s [file=]:     The path to the source file that needs updating"
     echo "    -x [pattern=]:  A pattern of files to exclude"
+    echo "    -o [options=]:  An options file to read additional options from" 
     echo ""
 }
 
@@ -43,6 +44,9 @@
         p)
             PAUSE_BEFORE_EXIT=1
             ;;
+        o)
+            CTAGS_ARGS="$CTAGS_ARGS --options=$OPTARG"
+            ;;
     esac
 done
 
--- a/plat/win32/update_tags.cmd	Tue Jul 29 16:11:24 2014 -0700
+++ b/plat/win32/update_tags.cmd	Thu Aug 21 11:32:32 2014 -0700
@@ -43,6 +43,11 @@
     shift
     goto :LoopParseArgs
 )
+if [%1]==[-o] (
+    set CTAGS_ARGS=%CTAGS_ARGS% --options=%2
+    shift
+    goto :LoopParseArgs
+)
 echo Invalid Argument: %1
 goto :Usage
 
@@ -57,7 +62,6 @@
 rem               GENERATE TAGS
 rem ==========================================
 
-set CTAGS_ARGS=
 if [%LOG_FILE%]==[] set LOG_FILE=CON
 
 echo Locking tags file... > %LOG_FILE%
@@ -68,7 +72,7 @@
         echo Removing references to: %UPDATED_SOURCE% >> %LOG_FILE%
         echo type "%TAGS_FILE%" ^| findstr /V /C:"%UPDATED_SOURCE%" ^> "%TAGS_FILE%.temp" >> %LOG_FILE%
         findstr /V /C:"%UPDATED_SOURCE%" "%TAGS_FILE%" > "%TAGS_FILE%.temp"
-        set CTAGS_ARGS=--append %UPDATED_SOURCE%
+        set CTAGS_ARGS=%CTAGS_ARGS% --append %UPDATED_SOURCE%
     )
 )
 
@@ -103,5 +107,6 @@
 echo    -t [file=tags]: The path to the ctags file to update
 echo    -s [file=]:     The path to the source file that needs updating
 echo    -l [log=]:      The log file to output to
+echo    -o [options=]:  An options file to read additional options from
 echo.
 
--- a/plugin/autotags.vim	Tue Jul 29 16:11:24 2014 -0700
+++ b/plugin/autotags.vim	Thu Aug 21 11:32:32 2014 -0700
@@ -49,6 +49,10 @@
 endif
 let g:autotags_project_root += ['.git', '.hg', '.bzr', '_darcs']
 
+if !exists('g:autotags_options_file')
+    let g:autotags_options_file = ''
+endif
+
 if !exists('g:autotags_exclude')
     let g:autotags_exclude = []
 endif
@@ -306,6 +310,9 @@
         if g:autotags_pause_after_update
             let l:cmd .= ' -p'
         endif
+        if len(g:autotags_options_file)
+            let l:cmd .= ' -o "' . g:autotags_options_file . '"'
+        endif
         if g:autotags_trace
             if has('win32')
                 let l:cmd .= ' -l "' . fnamemodify(l:tags_file, ':t') . '.log"'