diff options
-rwxr-xr-x | bollux | 26 |
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 |
4 | PRGN="${0##*/}" | 8 | PRGN="${0##*/}" |
@@ -6,6 +10,22 @@ VRSN=0.1 | |||
6 | # State | 10 | # State |
7 | REDIRECTS=0 | 11 | REDIRECTS=0 |
8 | 12 | ||
13 | bollux_usage() { | ||
14 | cat <<END | ||
15 | $PRGN (v. $VRSN): a bash gemini client | ||
16 | usage: | ||
17 | $PRGN [-h] | ||
18 | $PRGN [-q] [-v] [URL] | ||
19 | flags: | ||
20 | -h show this help and exit | ||
21 | -q be quiet: log no messages | ||
22 | -v verbose: log more messages | ||
23 | parameters: | ||
24 | URL the URL to start in | ||
25 | If not provided, the user will be prompted. | ||
26 | END | ||
27 | } | ||
28 | |||
9 | run() { | 29 | run() { |
10 | log debug "$@" | 30 | log debug "$@" |
11 | "$@" | 31 | "$@" |
@@ -49,8 +69,12 @@ bollux() { | |||
49 | } | 69 | } |
50 | 70 | ||
51 | bollux_args() { | 71 | bollux_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" ;; |