aboutsummaryrefslogtreecommitdiff
path: root/ponysay
diff options
context:
space:
mode:
authorErkin Batu Altunbaş <erkinbatu@gmail.com>2012-02-26 17:43:26 +0100
committerErkin Batu Altunbaş <erkinbatu@gmail.com>2012-02-26 17:43:26 +0100
commitaf081d264334ea5bf335eec70a2ee2f276b822da (patch)
tree432b1f40aa7043d4742b4f6446786308adbe2bfe /ponysay
parent3c5f2adc168f726c506270694983f9dbc1bde535 (diff)
downloadponysay-af081d264334ea5bf335eec70a2ee2f276b822da.tar.gz
ponysay-af081d264334ea5bf335eec70a2ee2f276b822da.tar.bz2
ponysay-af081d264334ea5bf335eec70a2ee2f276b822da.zip
I don't even know.
Diffstat (limited to 'ponysay')
-rwxr-xr-xponysay26
1 files changed, 26 insertions, 0 deletions
diff --git a/ponysay b/ponysay
new file mode 100755
index 0000000..2514001
--- /dev/null
+++ b/ponysay
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+PERL_UNICODE=S
+ponydir=/usr/share/ponies
+lponydir=/usr/local/share/ponies
+function ponyf() {
+ if [[ -f ${ponydir}/${1}.cow ]] ; then
+ cowsay -f "${ponydir}/${1}.cow" $@
+ elif [[ -f ${lponydir}/${1}.cow ]] ; then
+ cowsay -f "${lponydir}/${1}.cow" $@
+ else
+ ponyr
+ fi
+}
+function ponyr() {
+ cowsay -f $(ls /usr/share/ponies/*.cow | sort -R | head -n1) $@
+}
+
+while getopts f:h:v: OPT
+do
+ case ${OPT} in
+ v) echo "v0.01" ;;
+ h) echo "helpherpderp" ;;
+ f) ponyf $* ;;
+ *) ponyr $* ;;
+ esac
+done