about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xbollux26
1 files changed, 25 insertions, 1 deletions
diff --git a/bollux b/bollux index abd0ab9..f9ebdb6 100755 --- a/bollux +++ b/bollux
@@ -1,4 +1,8 @@
1#!/usr/bin/env bash 1#!/usr/bin/env bash
2# bollux: a bash gemini client
3# Author: Case Duckworth
4# License: MIT
5# Version: 0.1
2 6
3# Program information 7# Program information
4PRGN="${0##*/}" 8PRGN="${0##*/}"
@@ -6,6 +10,22 @@ VRSN=0.1
6# State 10# State
7REDIRECTS=0 11REDIRECTS=0
8 12
13bollux_usage() {
14 cat <<END
15$PRGN (v. $VRSN): a bash gemini client
16usage:
17 $PRGN [-h]
18 $PRGN [-q] [-v] [URL]
19flags:
20 -h show this help and exit
21 -q be quiet: log no messages
22 -v verbose: log more messages
23parameters:
24 URL the URL to start in
25 If not provided, the user will be prompted.
26END
27}
28
9run() { 29run() {
10 log debug "$@" 30 log debug "$@"
11 "$@" 31 "$@"
@@ -49,8 +69,12 @@ bollux() {
49} 69}
50 70
51bollux_args() { 71bollux_args() {
52 while getopts :vq OPT; do 72 while getopts :hvq OPT; do
53 case "$OPT" in 73 case "$OPT" in
74 h)
75 bollux_usage
76 exit
77 ;;
54 v) BOLLUX_LOGLEVEL=DEBUG ;; 78 v) BOLLUX_LOGLEVEL=DEBUG ;;
55 q) BOLLUX_LOGLEVEL=QUIET ;; 79 q) BOLLUX_LOGLEVEL=QUIET ;;
56 :) die 1 "Option -$OPTARG requires an argument" ;; 80 :) die 1 "Option -$OPTARG requires an argument" ;;