summaryrefslogtreecommitdiffstats
path: root/mk-teamocil
blob: 852cb6775543b765ffd80c35e1571b1026dbfb52 (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
#!/bin/bash
# generate Teamocil session comprising selected components
# jpokorny@redhat.com (will be pleased to know about further enhancements)
# licensed under GPLv2+ (note: this file only, not the bundled helper)

COMPONENTS="$@"

if [ $# -eq 0 ]; then
	echo "Usage: $0 [comp]* [-]"
	exit
elif [ ${@: -1} = '-' ]; then
	while read c; do
		COMPONENTS+=" ${c}"
	done
fi

cat <<-EOF
	session:
	  name: "bz"
	  windows:"
EOF
for c in $(echo ${COMPONENTS} | tr ' ' '\n' | sort); do
	cat <<-EOF
	  - name: "${c}"
	    panes:
	      - cmd: "watch-bz ${c}"
	EOF
done