ponysay/ponysay

25 lines
458 B
Text
Raw Normal View History

2012-02-26 17:43:26 +01:00
#!/usr/bin/env bash
2012-02-26 16:47:05 +01:00
export PERL_UNICODE=S
ponydir=$PWD/ponies
function ponyf() {
if [[ -f ${ponydir}/${1}.cow ]] ; then
cowsay -f "${ponydir}/${1}.cow" $@
else
2012-02-26 16:51:28 +01:00
ponyr
2012-02-26 16:47:05 +01:00
fi
}
function ponyr() {
cowsay -f $(ls ${ponydir}/*.cow | sort -R | head -n1) $@
}
while getopts f:hv OPT
do
case ${OPT} in
v) echo "v0.01" ; exit;;
h) echo "helpherpderp" ; exit;;
f) ponyf ${2}; exit;;
\?) show_error "DERP"; exit;;
esac
done