forked from sloum/bombadillo
Merge pull request 'Adds version command' (#198) from version-command into release2.3.3
Reviewed-on: sloum/bombadillo#198
This commit is contained in:
commit
b8ae9d659c
10
Makefile
10
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
|
||||
|
|
|
@ -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
|
||||
|
@ -246,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
|
||||
|
@ -259,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.
|
||||
|
||||
|
|
|
@ -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 ':', ' ':
|
||||
|
@ -345,6 +346,13 @@ func (c *client) simpleCommand(action string) {
|
|||
c.search("", "", "?")
|
||||
case "HELP", "?":
|
||||
c.Visit(helplocation)
|
||||
case "VERSION":
|
||||
ver := version
|
||||
if ver == "" {
|
||||
ver = "Improperly compiled, no version information"
|
||||
}
|
||||
c.SetMessage("Bombadillo version: " + ver, false)
|
||||
c.DrawMessage()
|
||||
default:
|
||||
c.SetMessage(syntaxErrorMessage(action), true)
|
||||
c.DrawMessage()
|
||||
|
|
|
@ -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}
|
||||
}
|
||||
|
||||
|
|
1
help.go
1
help.go
|
@ -23,6 +23,7 @@ var ERRS = map[string]string{
|
|||
"SET": "`set [setting] [value]`",
|
||||
"W": "`w [target]`",
|
||||
"WRITE": "`write [target]`",
|
||||
"VERSION": "`version`",
|
||||
"?": "`? [[command]]`",
|
||||
"HELP": "`help [[command]]`",
|
||||
}
|
||||
|
|
5
main.go
5
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()
|
||||
|
|
Loading…
Reference in New Issue