aboutsummaryrefslogtreecommitdiff
path: root/ponythink
diff options
context:
space:
mode:
authorErkin Batu Altunbaş <erkinbatu@gmail.com>2012-02-26 18:03:50 +0100
committerErkin Batu Altunbaş <erkinbatu@gmail.com>2012-02-26 18:03:50 +0100
commit14a680bb7c682b9e1f364c5a3018a460f5dfd890 (patch)
tree0719c3def9be5fb730e42c1277249932d171bb10 /ponythink
parent7b4ce006ccccd1360bb02a8353b3ca90792cacde (diff)
downloadponysay-14a680bb7c682b9e1f364c5a3018a460f5dfd890.tar.gz
ponysay-14a680bb7c682b9e1f364c5a3018a460f5dfd890.tar.bz2
ponysay-14a680bb7c682b9e1f364c5a3018a460f5dfd890.zip
ponythink
Diffstat (limited to 'ponythink')
-rwxr-xr-xponythink27
1 files changed, 27 insertions, 0 deletions
diff --git a/ponythink b/ponythink
new file mode 100755
index 0000000..2136187
--- /dev/null
+++ b/ponythink
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+export PERL_UNICODE=S
+
+ponydir=$PWD/ponies
+
+function ponyf() {
+ if [[ -f ${ponydir}/${1}.cow ]] ; then
+ cowthink -f "${ponydir}/${1}.cow" $@
+ else
+ ponyr $@
+ fi
+}
+function ponyr() {
+ cowthink -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 $* ; exit;;
+ \?) echo "DERP"; exit;;
+ *) ponyr $* ; exit;;
+ esac
+done
+ponyr $*