Put to ~/.profile

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
# Written by Gordio <[email protected]>
# Licence: MIT

# Need escape. I don't know why. (for ash)
\opkg () {
	BOLD=$(echo -e '\033[1m');
	NORM=$(echo -e '\033[0m');
	COL="no";
	for arg in $*; do
		if [ $arg == "whatdepends" -o $arg == "list" \
		-o $arg == "list-installed" -o $arg == "list-upgradable" \
		-o $arg == "list-changed-conffiles" -o $arg == "status" \
		-o $arg == "info" -o $arg == "find" ]; then
			COL="yes";
			break;
		fi
	done
	if [ $COL == "yes" ]; then
		# (|\t*) added for 'whatdepends'
		/bin/opkg $* | sed -re "s/^(|\t*)[a-z0-9-]*/$BOLD&$NORM/g";
	else
		/bin/opkg $*;
	fi
}
# vim: set fdm=marker ts=4 sw=4 tw=80 fo-=t ff=unix: