about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2020-05-23 19:45:21 -0500
committerCase Duckworth2020-05-23 19:45:21 -0500
commitace5aa5c97ff5965354f6e350a15b8e7295c9c91 (patch)
tree5f0bd40c4096a2f7d6cab1dbbd5d8d7a9a75c3ec
parentFix colors (diff)
downloadbollux-ace5aa5c97ff5965354f6e350a15b8e7295c9c91.tar.gz
bollux-ace5aa5c97ff5965354f6e350a15b8e7295c9c91.zip
Add usage()
-rwxr-xr-xbollux32
1 files changed, 27 insertions, 5 deletions
diff --git a/bollux b/bollux index 05c916b..b63e645 100755 --- a/bollux +++ b/bollux
@@ -4,14 +4,36 @@
4# License: MIT 4# License: MIT
5# Version: -0.7 5# Version: -0.7
6 6
7# set -euo pipefail # strict mode
8
7### constants ### 9### constants ###
8PRGN="${0##*/}" # program name 10PRGN="${0##*/}" # program name
9DLDR="${BOLLUX_DOWNDIR:-.}" # where to download 11DLDR="${BOLLUX_DOWNDIR:=.}" # where to download
10LOGL="${BOLLUX_LOGLEVEL:-3}" # log level 12LOGL="${BOLLUX_LOGLEVEL:=3}" # log level
11MAXR="${BOLLUX_MAXREDIR:-5}" # max redirects 13MAXR="${BOLLUX_MAXREDIR:=5}" # max redirects
12PORT="${BOLLUX_PORT:-1965}" # port number 14PORT="${BOLLUX_PORT:=1965}" # port number
13PROT="${BOLLUX_PROTO:-gemini}" # protocol 15PROT="${BOLLUX_PROTO:=gemini}" # protocol
14RDRS=0 # redirects 16RDRS=0 # redirects
17VRSN=-0.7 # version number
18
19# shellcheck disable=2120
20bollux_usage() {
21 cat <<END_USAGE >&2
22 $PRGN ($VRSN): a bash gemini client
23 usage:
24 $PRGN [-h]
25 $PRGN [-L LVL] [URL]
26 options:
27 -h show this help
28 -L LVL set the loglevel to LVL.
29 Default: $BOLLUX_LOGLEVEL
30 The loglevel is between 0 and 5, with
31 lower levels being more dire.
32 parameters:
33 URL the URL to navigate view or download
34END_USAGE
35 exit "${1:-0}"
36}
15 37
16# LOGLEVELS: 38# LOGLEVELS:
17# 0 - application fatal error 39# 0 - application fatal error