chneukirchen / knock

Knock is a simplification of the Test Anything Protocol used by Perl and others.

knock / knock.zsh
100644 7 lines (6 sloc) 0.151 kb
1
2
3
4
5
6
7
ok() {
   eval "$@" 2>&1 >/dev/null | sed 's/^/# /'
   EC=$pipestatus[1]
   [[ $EC = 0 ]] && echo "ok - $@" || echo "not ok - $@: $EC"
   return $EC
}