#!/bin/bash

# twitch-bar has a header line, so it should show "Does bar stuff" in the help description

usage() {
    cat <<END
Does bar stuff

Usage:
    twitch-bar [flags]

Flags:
    -h    Display this help message.
    -i    Display an alternative message
END
    exit 0
}

main() {
    echo "You ran twitch-bar"
    exit 0
}

flag_i() {
    echo "You ran twitch-bar with flag -i"
    exit 0
}

while getopts ":hi" opt; do
    case ${opt} in
    h )
        usage
        ;;
    i )
        flag_i
        ;;
    \? )
        echo "Invalid Option: -$OPTARG" 1>&2
        exit 1
        ;;
    : )
        echo "Invalid Option: -$OPTARG requires an argument" 1>&2
        exit 1
        ;;
    esac
done
shift $((OPTIND -1))

main
