summaryrefslogtreecommitdiff
path: root/etc/functions/anytag
blob: 0d3c090e1a91f59bf10ac7f5ab1ba06bc3c413a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
## vim:ft=zsh
## anytag - tag files based on symlinks (quick&dirty)

typeset -T REPLY reply ' '
typeset cmd=$1
typeset file tag

mkdir -p .tags
for file in *(.); do
	eval $cmd
	read
	for tag in $reply; do
		mkdir -p tags/$tag
		(
			cd tags/$tag
			ln -s ../../$file
		)
	done
done