2016-02-17 07:53:41 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2016-02-28 01:56:38 +00:00
|
|
|
function join {
|
|
|
|
local separator="$1"
|
|
|
|
shift
|
|
|
|
local retval="$( printf "${separator}%s" "$@" )"
|
|
|
|
retval="${retval:${#separator}}"
|
|
|
|
echo "${retval}"
|
|
|
|
}
|
|
|
|
|
|
|
|
excl_directories=(
|
|
|
|
./action_skel_code
|
|
|
|
./.git
|
|
|
|
./lib
|
|
|
|
"*/gtest"
|
|
|
|
)
|
|
|
|
excl_paths="-path $(join " -prune -o -path " "${excl_directories[@]}") -prune"
|
|
|
|
|
|
|
|
excl_wholefiles=(
|
|
|
|
)
|
|
|
|
if [ ${#excl_wholefiles[@]} -gt 0 ]; then
|
|
|
|
excl_files="-a ! -wholename $(join " -a ! -wholename " "${excl_wholefiles[@]}")"
|
|
|
|
else
|
|
|
|
excl_files=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
include_extensions=( cpp inl hpp h c )
|
|
|
|
incl_extensions="-name *.$(join " -o -name *." "${include_extensions[@]}")"
|
|
|
|
|
|
|
|
#Don't expand * - see http://stackoverflow.com/questions/102049/how-do-i-escape-the-wildcard-asterisk-character-in-bash
|
|
|
|
set -f
|
2016-05-04 17:40:08 +00:00
|
|
|
find . \( $excl_paths -o \( $incl_extensions \) \) -a -type f $excl_files > cscope.files
|
2016-02-28 01:56:38 +00:00
|
|
|
set +f
|
2016-02-17 07:53:41 +00:00
|
|
|
|
2016-03-03 19:46:30 +00:00
|
|
|
exec cscope -b -q
|