#!/usr/bin/env sh

# strfile /home/bjb/share/magic-8-ball /home/bjb/share/magic-8-ball.dat

usage() {
    echo "$0 [-b | -w ]"
    echo "-b:  something on a scale of false/no/impossible to true/yes/certainty"
    echo "-w:  time estimate"
    echo "-h:  help"
}

while getopts wbh opt ; do
    case $opt in
        h) usage ; exit ;;
        w) TYPE=when ;;
        b) TYPE=bool ;;
        *) echo "Unknown option $opt" ; usage ; exit ;;
    esac
done

fortune /home/bjb/share/magic-8-ball.$TYPE

