#!/usr/bin/env bash
+# bollux: a bash gemini client
+# Author: Case Duckworth
+# License: MIT
+# Version: 0.1
# Program information
PRGN="${0##*/}"
# State
REDIRECTS=0
+bollux_usage() {
+ cat <<END
+$PRGN (v. $VRSN): a bash gemini client
+usage:
+ $PRGN [-h]
+ $PRGN [-q] [-v] [URL]
+flags:
+ -h show this help and exit
+ -q be quiet: log no messages
+ -v verbose: log more messages
+parameters:
+ URL the URL to start in
+ If not provided, the user will be prompted.
+END
+}
+
run() {
log debug "$@"
"$@"
}
bollux_args() {
- while getopts :vq OPT; do
+ while getopts :hvq OPT; do
case "$OPT" in
+ h)
+ bollux_usage
+ exit
+ ;;
v) BOLLUX_LOGLEVEL=DEBUG ;;
q) BOLLUX_LOGLEVEL=QUIET ;;
:) die 1 "Option -$OPTARG requires an argument" ;;