From 9c2caf4a6f2c43a6b96d8064b188244a1aeaa18a Mon Sep 17 00:00:00 2001 From: sloumdrone Date: Sun, 27 Oct 2019 11:09:45 -0700 Subject: [PATCH] Updates man page --- README.md | 6 ++++-- bombadillo.1 | 4 ++-- client.go | 58 +++++----------------------------------------------- main.go | 6 ------ 4 files changed, 11 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index 7593b85..eb09b0f 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,11 @@ These instructions will get a copy of the project up and running on your local m ### Prerequisites -If building from source, you will need to have [Go](https://golang.org/) version >= 1.12. +If building from source, you will need to have [Go](https://golang.org/) version >= 1.11. -While Bombadillo has one external dependency of [Mailcap](https://tildegit.org/sloum/mailcap), no action is typically required to download this, as it is handled automatically during the build process. +#### Optional + +[Lynx](https://lynx.invisible-island.net/), the text based web browser, can be used as a parsing engine for http/https. This is a totally optional item and Lynx is in no way required in order to compile or run Bombadillo. Having it available on the system can help create a richer experience by allowing users to navigate directly to web content in Bombadillo. Many users may wish to avoid this entirely,a nd the default configuration does not have this behavior turned on. To turn it on from within Bombadillo enter the command `set lynxmode true`. ### Installing diff --git a/bombadillo.1 b/bombadillo.1 index 72baf04..b694e3a 100644 --- a/bombadillo.1 +++ b/bombadillo.1 @@ -1,4 +1,4 @@ -.TH "bombadillo" 1 "12 OCT 2019" "" "General Operation Manual" +.TH "bombadillo" 1 "27 OCT 2019" "" "General Operation Manual" .SH NAME \fBbombadillo \fP- a non-web client .SH SYNOPSIS @@ -28,7 +28,7 @@ Gopher is the default protocol for \fBbombadillo\fP. Any textual item types will .TP .B gemini -Gemini is supported, but as a new protocol with an incomplete specification, features may change over time. At present Bombadillo supports TLS with a trust on first use certificate pinning system (similar to SSH). Client certificates are also supported via option configuration. Gemini maps and other text types are rendered in the client and non-text types will trigger a prompt to the user to download or open in an appropriate program. +Gemini is supported, but as a new protocol with an incomplete specification, features may change over time. At present Bombadillo supports TLS with a trust on first use certificate pinning system (similar to SSH). Client certificates are also supported via option configuration. Gemini maps and other text types are rendered in the client and non-text types will be downloaded. .TP .B finger diff --git a/client.go b/client.go index f106183..452dad1 100644 --- a/client.go +++ b/client.go @@ -936,62 +936,14 @@ func (c *client) handleGemini(u Url) { c.SetHeaderUrl() c.Draw() } else { - c.SetMessage("The file is non-text: (o)pen or (w)rite to disk", false) + c.SetMessage("The file is non-text: writing to disk...", false) c.DrawMessage() - var ch rune - for { - ch = cui.Getch() - if ch == 'o' || ch == 'w' { - break - } - } - switch ch { - case 'o': - mime := fmt.Sprintf("%s/%s", capsule.MimeMaj, capsule.MimeMin) - var term bool - if c.Options["terminalonly"] == "true" { - term = true - } else { - term = false - } - mcEntry, err := mc.FindMatch(mime, "view", term) - if err != nil { - c.SetMessage(err.Error(), true) - c.DrawMessage() - return - } - file, err := ioutil.TempFile("/tmp/", "bombadillo-*.tmp") - if err != nil { - c.SetMessage("Unable to create temporary file for opening, aborting file open", true) - c.DrawMessage() - return - } - // defer os.Remove(file.Name()) - file.Write([]byte(capsule.Content)) - com, e := mcEntry.Command(file.Name()) - if e != nil { - c.SetMessage(e.Error(), true) - c.DrawMessage() - return - } - com.Stdin = os.Stdin - com.Stdout = os.Stdout - com.Stderr = os.Stderr - if c.Options["terminalonly"] == "true" { - cui.Clear("screen") - } - com.Run() - c.SetMessage("File opened by an appropriate program", true) - c.DrawMessage() - c.Draw() - case 'w': - nameSplit := strings.Split(u.Resource, "/") - filename := nameSplit[len(nameSplit)-1] - c.saveFileFromData(capsule.Content, filename) - } + nameSplit := strings.Split(u.Resource, "/") + filename := nameSplit[len(nameSplit)-1] + c.saveFileFromData(capsule.Content, filename) } case 3: - c.SetMessage("[3] Redirect. Follow redirect? y or any other key for no", false) + c.SetMessage(fmt.Sprintf("Follow redirect (y/n): %s?", capsule.Content), false) c.DrawMessage() ch := cui.Getch() if ch == 'y' || ch == 'Y' { diff --git a/main.go b/main.go index 6108ebc..2e1860e 100644 --- a/main.go +++ b/main.go @@ -30,7 +30,6 @@ import ( "tildegit.org/sloum/bombadillo/config" "tildegit.org/sloum/bombadillo/cui" _ "tildegit.org/sloum/bombadillo/gemini" - "tildegit.org/sloum/mailcap" ) var version string @@ -39,7 +38,6 @@ var build string var bombadillo *client var helplocation string = "gopher://bombadillo.colorfield.space:70/1/user-guide.map" var settings config.Config -var mc *mailcap.Mailcap func saveConfig() error { var opts strings.Builder @@ -194,10 +192,6 @@ func main() { } args := flag.Args() - // Build the mailcap db - // So that we can open files from gemini - mc = mailcap.NewMailcap() - cui.InitTerm() defer cui.Exit() err := initClient()