moth/pkg/transpile/testdata/static/3/mkpuzzle

45 lines
820 B
Plaintext
Raw Normal View History

2020-08-31 16:37:51 -06:00
#! /bin/sh
case $1 in
"")
cat <<'EOT'
{
"Answers": ["answer"],
"Pre": {
2020-09-01 20:12:57 -06:00
"Authors": ["neale"],
2020-08-31 16:37:51 -06:00
"Body": "I am a generated puzzle."
}
}
EOT
;;
2020-09-04 13:00:23 -06:00
-file|--file)
case $2 in
moo.txt)
echo "Moo."
;;
*)
echo "ERROR: no such file: $1" 1>&2
exit 1
;;
esac
;;
-answer|--answer)
case $2 in
moo)
echo "correct"
;;
error)
echo "error" 1>&2
exit 1
;;
*)
echo "incorrect"
;;
esac
2020-08-31 16:37:51 -06:00
;;
*)
2020-09-04 13:00:23 -06:00
echo "ERROR: don't know what to do with $1" 1>&2
2020-08-31 16:37:51 -06:00
exit 1
;;
esac