mirror of
https://github.com/erkin/ponysay.git
synced 2025-02-16 17:44:23 +01:00
ponythink
This commit is contained in:
parent
7b4ce006cc
commit
14a680bb7c
1 changed files with 27 additions and 0 deletions
27
ponythink
Executable file
27
ponythink
Executable file
|
@ -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 $*
|
Loading…
Reference in a new issue