diff options
author | Sven-Hendrik Haase <sh@lutzhaase.com> | 2012-02-26 18:30:33 +0100 |
---|---|---|
committer | Sven-Hendrik Haase <sh@lutzhaase.com> | 2012-02-26 18:30:33 +0100 |
commit | 2ee2c38c7a13f273c05b3ce165e89507463befa0 (patch) | |
tree | cad6820554674380a156d77ef16c3cbc8cf35a0b /ponythink | |
parent | 88d9965243d72b45895615084a228a8edd7fd366 (diff) | |
parent | 0e7aca39207cad2e41225bfa36bdee84f2a195b8 (diff) | |
download | ponysay-2ee2c38c7a13f273c05b3ce165e89507463befa0.tar.gz ponysay-2ee2c38c7a13f273c05b3ce165e89507463befa0.tar.bz2 ponysay-2ee2c38c7a13f273c05b3ce165e89507463befa0.zip |
Merged
Diffstat (limited to 'ponythink')
-rwxr-xr-x | ponythink | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ponythink b/ponythink new file mode 100755 index 0000000..d43e84d --- /dev/null +++ b/ponythink @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +export PERL_UNICODE=S +ponydir=/usr/share/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 $* |