M Makefile => Makefile +1 -2
@@ 24,8 24,7 @@ astronaut.1: doc/astronaut.1.scd
astronaut: $(GOSRC)
$(GO) build $(GOFLAGS) \
- -ldflags "-X main.Version=$(VERSION) \
- -X main.ShareDir=$(SHAREDIR)" \
+ -ldflags "-X main.ShareDir=$(SHAREDIR)" \
-o $@
clean:
M about/about.tmpl => about/about.tmpl +0 -2
@@ 2,8 2,6 @@
A Gemini browser for the terminal.
-Version: {{.Version}}
-
=> https://sr.ht/~adnano/astronaut astronaut homepage
The following is a list of "about" pages for your convenience.
M configure => configure +0 -2
@@ 1,7 1,6 @@
#!/bin/sh -e
RELEASE=0.1.0
-ver="$(git describe --tags --dirty 2>/dev/null || printf "%s" "$RELEASE")"
gosrc="$(find . -name '*.go' -print)"
exec > config.mk
@@ 13,7 12,6 @@ for opt; do
esac
done
-printf "VERSION = %s\n" "$ver"
printf "GOSRC = "
# word splitting is desired
M doc/astronaut.1.scd => doc/astronaut.1.scd +1 -6
@@ 6,12 6,7 @@ astronaut - a Gemini browser for the terminal
# SYNOPSIS
-_astronaut_ [-v] [URL]
-
-# OPTIONS
-
-*-v*
- Prints version information for the astronaut program.
+_astronaut_ [URL]
# COMMANDS
M main.go => main.go +2 -8
@@ 18,25 18,19 @@ import (
)
var (
- Version string
ShareDir string
)
func main() {
flag := flag.NewFlagSet("", flag.ExitOnError)
flag.Usage = func() {
- fmt.Printf("usage: %s [-v] [URL]\n", os.Args[0])
+ fmt.Printf("usage: %s [URL]\n", os.Args[0])
}
- version := flag.Bool("v", false, "print version")
flag.Parse(os.Args[1:])
- if flag.NArg() > 2 {
+ if flag.NArg() > 1 {
flag.Usage()
return
}
- if *version {
- fmt.Println("astronaut", Version)
- return
- }
url := flag.Arg(0)
if err := run(url); err != nil {
M tab.go => tab.go +1 -3
@@ 459,9 459,7 @@ func (t *Tab) doRequest(ctx context.Context, req *gemini.Request) (*gemini.Respo
func (t *Tab) handleAbout(w gemini.ResponseWriter, r *gemini.Request) {
switch r.URL.Host {
case "about":
- templates.ExecuteTemplate(w, "about.tmpl", &struct {
- Version string
- }{Version})
+ templates.ExecuteTemplate(w, "about.tmpl", nil)
case "bookmarks":
path := filepath.Join(xdg.DataHome(), "astronaut", "bookmarks.gmi")
gemini.ServeFile(w, os.DirFS(""), path)