From 95837e108a233f345130e965b0f39ca158f438ab Mon Sep 17 00:00:00 2001 From: asdf Date: Tue, 22 Oct 2019 14:45:39 +1100 Subject: [PATCH 1/3] Added printHelp, provide more info on -h and -v --- main.go | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 1189d77..1514243 100644 --- a/main.go +++ b/main.go @@ -112,7 +112,7 @@ func loadConfig() error { if lowerkey == "configlocation" { // The config defaults to the home folder. // Users cannot really edit this value. But - // a compile time override is available. + // a compile time override is available. // It is still stored in the ini and as a part // of the options map. continue @@ -161,11 +161,28 @@ func handleSIGCONT(c <-chan os.Signal) { } } +//printHelp produces a nice display message when the --help flag is used +func printHelp() { + art := `Bombadillo + +Syntax: bombadillo [url] + bombadillo [options...] + +Example: bombadillo gopher://bombadillo.colorfield.space + bombadillo -v + +Options: +` + fmt.Fprint(os.Stdout, art) + flag.PrintDefaults() +} + func main() { - getVersion := flag.Bool("v", false, "See version number") + getVersion := flag.Bool("v", false, "Print version information and exit") + flag.Usage = printHelp flag.Parse() if *getVersion { - fmt.Printf("Bombadillo %s\n", version) + fmt.Printf("Bombadillo %s - build %s\n", version, build) os.Exit(0) } args := flag.Args() From 17b1e6eff280047e4829ee7c5fcfc35a6c666474 Mon Sep 17 00:00:00 2001 From: asdf Date: Tue, 22 Oct 2019 15:00:01 +1100 Subject: [PATCH 2/3] Unified wording, updated man page --- README.md | 2 +- bombadillo.1 | 5 +++-- main.go | 10 +++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 814f10e..f16e7b0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Bombadillo +# Bombadillo - a non-web client Bombadillo is a modern [Gopher](https://en.wikipedia.org/wiki/Gopher_(protocol)) client for the terminal, and functions as a pager/terminal UI. Bombadillo features vim-like keybindings, configurable settings, and a robust command selection. Bombadillo is under active development. diff --git a/bombadillo.1 b/bombadillo.1 index 1d28a72..e01925f 100644 --- a/bombadillo.1 +++ b/bombadillo.1 @@ -5,7 +5,8 @@ .SH SYNOPSIS .nf .fam C -\fBbombadillo\fP [\fB-v\fP] [\fB-h\fP] [\fIurl\fP] +\fBbombadillo\fP [\fIurl\fP] +\fBbombadillo\fP [\fBOPTION\fP] .fam T .fi .SH DESCRIPTION @@ -14,7 +15,7 @@ .TP .B \fB-v\fP -Display the version number of \fBbombadillo\fP. +Display version information and exit. .TP .B \fB-h\fP diff --git a/main.go b/main.go index 1514243..4bd03f0 100644 --- a/main.go +++ b/main.go @@ -163,13 +163,13 @@ func handleSIGCONT(c <-chan os.Signal) { //printHelp produces a nice display message when the --help flag is used func printHelp() { - art := `Bombadillo + art := `Bombadillo - a non-web client -Syntax: bombadillo [url] - bombadillo [options...] +Syntax: bombadillo [url] + bombadillo [options...] -Example: bombadillo gopher://bombadillo.colorfield.space - bombadillo -v +Examples: bombadillo gopher://bombadillo.colorfield.space + bombadillo -v Options: ` From 1bc6e75ada094118964a5e5fdf6d536da8c5eb9f Mon Sep 17 00:00:00 2001 From: asdf Date: Tue, 22 Oct 2019 15:07:37 +1100 Subject: [PATCH 3/3] Unified wording for -v option --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 4bd03f0..6a71c13 100644 --- a/main.go +++ b/main.go @@ -178,7 +178,7 @@ Options: } func main() { - getVersion := flag.Bool("v", false, "Print version information and exit") + getVersion := flag.Bool("v", false, "Display version information and exit") flag.Usage = printHelp flag.Parse() if *getVersion {