ctags.kak: Replace some subshells with parameter expansions

This commit is contained in:
Maxime Coste 2016-11-16 10:01:08 +00:00
parent 27265b655a
commit 16b8615089

View File

@ -12,7 +12,7 @@ def -params ..1 \
[ -f "$candidate" ] && readlink -f "$candidate" [ -f "$candidate" ] && readlink -f "$candidate"
done | awk \'!x[$0]++\' | # remove duplicates done | awk \'!x[$0]++\' | # remove duplicates
while read -r tags; do while read -r tags; do
namecache=$(dirname "$tags")/.kak.$(basename "$tags").namecache namecache="${tags%/*}/.kak.${tags##*/}.namecache"
if [ -z "$(find "$namecache" -prune -newer "$tags")" ]; then if [ -z "$(find "$namecache" -prune -newer "$tags")" ]; then
cut -f 1 "$tags" | uniq > "$namecache" cut -f 1 "$tags" | uniq > "$namecache"
fi fi
@ -28,7 +28,7 @@ If no symbol is passed then the current selection is used as symbol name} \
[ -f "$candidate" ] && readlink -f "$candidate" [ -f "$candidate" ] && readlink -f "$candidate"
done | awk '!x[$0]++' | # remove duplicates done | awk '!x[$0]++' | # remove duplicates
while read -r tags; do while read -r tags; do
printf '!TAGROOT\t%s\n' "$(readlink -f $(dirname "$tags"))/" printf '!TAGROOT\t%s\n' "$(readlink -f "${tags%/*}")/"
readtags -t "$tags" $tagname readtags -t "$tags" $tagname
done | awk -F '\t|\n' ' done | awk -F '\t|\n' '
/^!TAGROOT\t/ { tagroot=$2 } /^!TAGROOT\t/ { tagroot=$2 }