From 228ec598ab89d361bfa4e173b31762b0e7e1614e Mon Sep 17 00:00:00 2001 From: sloum Date: Sun, 1 Nov 2020 06:55:46 -0800 Subject: [PATCH 1/6] Adds version command --- VERSION | 2 +- client.go | 3 +++ cmdparse/lexer.go | 2 +- help.go | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index f90b1af..0bee604 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.3.2 +2.3.3 diff --git a/client.go b/client.go index 4b31efb..7b65044 100644 --- a/client.go +++ b/client.go @@ -345,6 +345,9 @@ func (c *client) simpleCommand(action string) { c.search("", "", "?") case "HELP", "?": go c.Visit(helplocation) + case "VERSION": + c.SetMessage("Bombadillo version: " + version, false) + c.DrawMessage() default: c.SetMessage(syntaxErrorMessage(action), true) c.DrawMessage() diff --git a/cmdparse/lexer.go b/cmdparse/lexer.go index 8b882c3..c17eb4f 100644 --- a/cmdparse/lexer.go +++ b/cmdparse/lexer.go @@ -72,7 +72,7 @@ func (s *scanner) scanText() Token { "S", "SET", "R", "RELOAD", "SEARCH", "Q", "QUIT", "B", "BOOKMARKS", "H", "HOME", "?", "HELP", "C", "CHECK", - "P", "PURGE": + "P", "PURGE", "VERSION": return Token{Action, capInput} } diff --git a/help.go b/help.go index a9516f3..c927cf7 100644 --- a/help.go +++ b/help.go @@ -25,4 +25,5 @@ var ERRS = map[string]string{ "WRITE": "`write [target]`", "?": "`?`", "HELP": "`help`", + "VERSION": "`version`", } From 82d0742d5244f0614c8985bde00315ff5dce86c4 Mon Sep 17 00:00:00 2001 From: sloum Date: Thu, 5 Nov 2020 07:47:08 -0800 Subject: [PATCH 2/6] Adds update to man page --- bombadillo.1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bombadillo.1 b/bombadillo.1 index a66816d..4210218 100644 --- a/bombadillo.1 +++ b/bombadillo.1 @@ -209,6 +209,10 @@ set [setting name] [value] Sets the value for a given configuration setting. \fIs\fP can be used instead of the full \fIset\fP. .TP .B +version +Shows the current Bombadillo version number. +.TP +.B write . Writes the current document to a file. The file is named by the last component of the url path. If the last component is blank or \fI/\fP a default name will be used. The file saves to the directory set by the \fIsavelocation\fP setting. \fIw\fP can be entered rather than the full \fIwrite\fP. .TP From 1ae3312ad6ef12b7ee817b942e351de9ad1ed8d3 Mon Sep 17 00:00:00 2001 From: sloum Date: Thu, 5 Nov 2020 19:33:54 -0800 Subject: [PATCH 3/6] Handles the case where no version information is available --- client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index edebd57..7c22769 100644 --- a/client.go +++ b/client.go @@ -346,7 +346,11 @@ func (c *client) simpleCommand(action string) { case "HELP", "?": c.Visit(helplocation) case "VERSION": - c.SetMessage("Bombadillo version: " + version, false) + ver := version + if ver == "" { + ver = "Improperly compiled, no version information" + } + c.SetMessage("Bombadillo version: " + ver, false) c.DrawMessage() default: c.SetMessage(syntaxErrorMessage(action), true) From d78e2f4205855f0ea1f2947c31392251796f85d6 Mon Sep 17 00:00:00 2001 From: sloum Date: Sun, 8 Nov 2020 10:30:22 -0800 Subject: [PATCH 4/6] Adds further fixes to the man page. I had noticed some issues. --- bombadillo.1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bombadillo.1 b/bombadillo.1 index 4210218..cc404d4 100644 --- a/bombadillo.1 +++ b/bombadillo.1 @@ -250,7 +250,7 @@ The path to the directory that \fBbombadillo\fP should write files to. This must .TP .B searchengine -The url to use for the LINE COMMANDs \fI?\fP and \fIsearch\fP. Should be a valid search path that terms may be appended to. +The url to use for the LINE COMMAND \fIsearch\fP. Should be a valid search path that terms may be appended to. .TP .B telnetcommand @@ -263,6 +263,8 @@ Can toggle between visual modes. Valid values are \fInormal\fP, \fIcolor\fP, and .B timeout The number of seconds after which connections to gopher or gemini servers should time out if the server has not responded. +.TP +.B webmode Controls behavior when following web links. The following values are valid: \fInone\fP will disable following web links, \fIgui\fP will have the browser attempt to open web links in a user's default graphical web browser; \fIlynx\fP, \fIw3m\fP, and \fIelinks\fP will have the browser attempt to use the selected terminal web browser to handle the rendering of web pages and will display the pages directly in Bombadillo. From ee56961b2034b435142c976aa654cc7b9afdf4c5 Mon Sep 17 00:00:00 2001 From: sloum Date: Thu, 12 Nov 2020 20:24:19 -0800 Subject: [PATCH 5/6] Fixes a regression where searches did not clear out previous search highlights --- client.go | 1 + 1 file changed, 1 insertion(+) diff --git a/client.go b/client.go index 7c22769..c8535eb 100644 --- a/client.go +++ b/client.go @@ -258,6 +258,7 @@ func (c *client) TakeControlInput() { } err = c.NextSearchItem(0) if err != nil { + c.PageState.History[c.PageState.Position].WrapContent(c.Width-1,(c.Options["theme"] == "color")) c.Draw() } case ':', ' ': From f18dc293fd47cf344a1c6ea068acfc91b30ccc7b Mon Sep 17 00:00:00 2001 From: sloum Date: Thu, 12 Nov 2020 20:51:21 -0800 Subject: [PATCH 6/6] Removes previous version build system in favor of simple variable --- Makefile | 10 +--------- main.go | 5 ++--- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index ddbc4bc..cca7657 100644 --- a/Makefile +++ b/Makefile @@ -13,17 +13,9 @@ test : GOCMD := go1.11.13 # %:z - so settle for %z. BUILD_TIME := ${shell date "+%Y-%m-%dT%H:%M%z"} -# If VERSION is empty or not defined use the contents of the VERSION file -VERSION := ${shell git describe --exact-match 2> /dev/null} -ifndef VERSION - VERSION := ${shell cat ./VERSION} -endif - -LDFLAGS := -ldflags "-s -X main.version=${VERSION} -X main.build=${BUILD_TIME}" - .PHONY: build build: - ${GOCMD} build ${LDFLAGS} -o ${BINARY} + ${GOCMD} build -o ${BINARY} .PHONY: install install: install-bin install-man install-desktop clean diff --git a/main.go b/main.go index 82c27da..bee9c41 100644 --- a/main.go +++ b/main.go @@ -35,8 +35,7 @@ import ( "tildegit.org/sloum/bombadillo/gemini" ) -var version string -var build string +var version string = "2.3.3" var bombadillo *client var helplocation string = "gopher://bombadillo.colorfield.space:70/1/user-guide.map" @@ -211,7 +210,7 @@ func main() { flag.Usage = printHelp flag.Parse() if *getVersion { - fmt.Printf("Bombadillo %s - build %s\n", version, build) + fmt.Printf("Bombadillo %s\n", version) os.Exit(0) } args := flag.Args()