Add usage and header

This commit is contained in:
Case Duckworth 2020-05-25 21:41:42 -05:00
parent 709334eb96
commit 37d105bb50
1 changed files with 25 additions and 1 deletions

26
bollux
View File

@ -1,4 +1,8 @@
#!/usr/bin/env bash
# bollux: a bash gemini client
# Author: Case Duckworth
# License: MIT
# Version: 0.1
# Program information
PRGN="${0##*/}"
@ -6,6 +10,22 @@ VRSN=0.1
# 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 "$@"
"$@"
@ -49,8 +69,12 @@ bollux() {
}
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" ;;