summaryrefslogtreecommitdiff
path: root/Biz/Ide/mktags.sh
blob: aae15058b5d4d861134b3297499240b638e5ab61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
#
# script to generate tags automatically if there are none.
#
  set -euo pipefail
  files="$*"
  vimtags=${CODEROOT:?}/tags
  emacstags=${CODEROOT:?}/TAGS
#
  if [[ ! -r $emacstags ]]; then
      echo Generating emacs TAGS from scratch...
      fast-tags -e -R "${CODEROOT:?}"
      ctags -e \
           --append=yes \
           --recurse=yes \
           --exclude="$CODEROOT/_/*" \
           "${CODEROOT:?}"
  else
      fast-tags -e "$files"
      ctags -e \
           --append=yes \
           --exclude="_/*" \
           "$files"
  fi
#
  if [[ ! -r $vimtags ]]; then
      echo Generating vim tags from scratch...
      fast-tags -R "${CODEROOT:?}"
      ctags \
           --append=yes \
           --recurse=yes \
           --exclude="${CODEROOT:?}/_/*" \
           "${CODEROOT:?}"
  else
      fast-tags "$files"
      ctags \
           --append=yes \
           --exclude="_/*" \
           "$files"
  fi
##