changeset 161:97e1b266d045

Implement new ctags features for Unix platforms.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 17 Feb 2017 20:34:30 -0800
parents 1b980f5071a0
children 0f6605a9398b
files plat/unix/update_tags.sh
diffstat 1 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plat/unix/update_tags.sh	Fri Feb 17 17:21:57 2017 -0800
+++ b/plat/unix/update_tags.sh	Fri Feb 17 20:34:30 2017 -0800
@@ -10,6 +10,7 @@
 FILE_LIST_CMD=
 FILE_LIST_CMD_IS_ABSOLUTE=0
 UPDATED_SOURCE=
+POST_PROCESS_CMD=
 PAUSE_BEFORE_EXIT=0
 
 
@@ -26,12 +27,14 @@
     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 "    -O [params=]:   Parameters to pass to ctags"
+    echo "    -P [cmd=]:      Post process command to run on the tags file"
     echo "    -c:             Ask for confirmation before exiting"
     echo ""
 }
 
 
-while getopts "h?e:x:t:p:L:s:o:cA" opt; do
+while getopts "h?e:x:t:p:L:s:o:O:P:cA" opt; do
     case $opt in
         h|\?)
             ShowUsage
@@ -64,6 +67,12 @@
         o)
             CTAGS_ARGS="$CTAGS_ARGS --options=$OPTARG"
             ;;
+        O)
+            CTAGS_ARGS="$CTAGS_ARGS $OPTARG"
+            ;;
+        P)
+            POST_PROCESS_CMD=$OPTARG
+            ;;
     esac
 done
 
@@ -113,6 +122,12 @@
     $CTAGS_EXE -f "$TAGS_FILE.temp" $CTAGS_ARGS --append "$UPDATED_SOURCE"
 fi
 
+if [ "$POST_PROCESS_CMD" != "" ]; then
+    echo "Running post process"
+    echo "$POST_PROCESS_CMD \"$TAGS_FILE.temp\""
+    $POST_PROCESS_CMD "$TAGS_FILE.temp"
+fi
+
 echo "Replacing tags file"
 echo "mv -f \"$TAGS_FILE.temp\" \"$TAGS_FILE\""
 mv -f "$TAGS_FILE.temp" "$TAGS_FILE"