summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Häggqvist <[email protected]>2016-03-28 00:41:14 +0200
committerVictor Häggqvist <[email protected]>2016-03-28 00:41:14 +0200
commitf6fd580a0e597de23f0eab351e8d2fdfcfb520e2 (patch)
treef8e92215afedec24f7078f47fe07b9bada6a424a
parent3b9654c123d7cd6c9932a7c260ef041c26f7d4aa (diff)
use my pflag and goxc
-rw-r--r--.gitignore27
-rw-r--r--Godeps/Godeps.json10
-rw-r--r--Makefile18
-rw-r--r--docs/_build/man/goboom.12
-rw-r--r--goboom.go8
5 files changed, 48 insertions, 17 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..42fd47a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,27 @@
+# Compiled Object files, Static and Dynamic libs (Shared Objects)
+*.o
+*.a
+*.so
+
+# Folders
+_obj
+_test
+
+# Architecture specific extensions/prefixes
+*.[568vq]
+[568vq].out
+
+*.cgo1.go
+*.cgo2.c
+_cgo_defun.c
+_cgo_gotypes.go
+_cgo_export.*
+
+_testmain.go
+
+*.exe
+*.test
+*.prof
+build
+debian
+docs/_build
diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json
index 7a10d89..7900291 100644
--- a/Godeps/Godeps.json
+++ b/Godeps/Godeps.json
@@ -1,6 +1,6 @@
{
- "ImportPath": "snilius.com/goboom",
- "GoVersion": "go1.5.3",
+ "ImportPath": "github.com/victorhaggqvist/goboom",
+ "GoVersion": "go1.6",
"Deps": [
{
"ImportPath": "github.com/go-ini/ini",
@@ -12,9 +12,9 @@
"Rev": "c9648aef1bdc65989a5db138c92442e3b1370ecc"
},
{
- "ImportPath": "github.com/ogier/pflag",
- "Comment": "v0.0.1-7-g45c278a",
- "Rev": "45c278ab3607870051a2ea9040bb85fcb8557481"
+ "ImportPath": "github.com/victorhaggqvist/pflag",
+ "Comment": "v0.0.1-8-gde7e394",
+ "Rev": "de7e39409b4761c1704b5c822a8a152f4493a161"
}
]
}
diff --git a/Makefile b/Makefile
index ab16c80..fbfae46 100644
--- a/Makefile
+++ b/Makefile
@@ -1,22 +1,26 @@
SHELL = /bin/bash
+VERSION=0.2.1
all:
- @echo goboom makefile
+ @echo goboom makefile $(VERSION)
@echo \"make build\" to build
.PHONY: build
build:
- go build goboom.go
+ goxc -pv="$(VERSION)" -build-ldflags='-X main.version=$(VERSION)' xc
.PHONY: package
-package: build
- tar cf goboom_linux_amd64.tar.xz goboom goboom_run README.rst docs/_build/man/goboom.1
- sha512sum goboom_linux_amd64.tar.xz > goboom_linux_amd64.tar.xz.sha512sum
+package: man
+ goxc -pv="$(VERSION)" -build-ldflags='-X main.version=$(VERSION)'
.PHONY: html
html:
- pushd docs && make html && popd
+ pushd docs && make html SPHINXOPTS="-Dversion=$(VERSION) -Drelease=$(VERSION)" && popd
.PHONY: man
man:
- pushd docs && make man && popd
+ pushd docs && make man SPHINXOPTS="-Dversion=$(VERSION) -Drelease=$(VERSION)" && popd
+
+.PHONY: upload
+upload:
+ goxc -pv="$(VERSION)" bintray
diff --git a/docs/_build/man/goboom.1 b/docs/_build/man/goboom.1
index 8700781..31b1397 100644
--- a/docs/_build/man/goboom.1
+++ b/docs/_build/man/goboom.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "GOBOOM" "1" "February 02, 2016" "0.1" "goboom"
+.TH "GOBOOM" "1" "March 28, 2016" "0.2.1" "goboom"
.SH NAME
goboom \- a dmenu wrapper
.
diff --git a/goboom.go b/goboom.go
index 361bbcf..0c8dad8 100644
--- a/goboom.go
+++ b/goboom.go
@@ -7,16 +7,15 @@ import (
"os"
"os/user"
"path/filepath"
- "runtime"
"sort"
"strings"
"github.com/go-ini/ini"
"github.com/gocarina/gocsv"
- flag "github.com/ogier/pflag"
+ flag "github.com/victorhaggqvist/pflag"
)
-const version = "0.2"
+var version = "0.0.0" // injected at build time
type Runnable struct {
Cmd string `csv:"name"`
@@ -227,8 +226,9 @@ func main() {
flag.BoolVar(&postPhase, "post", false, "Update ranking DB")
flag.BoolVar(&stats, "stats", false, "View DB stats")
flag.BoolVar(&gc, "gc", false, "Run garbage collection of the DB")
+ flag.Version = version
flag.Usage = func() {
- fmt.Printf("goboom v%s (%s/%s/%s)\n", version, runtime.GOOS, runtime.GOARCH, runtime.Version())
+ flag.PrintVersion()
fmt.Print("\nTo actually use goboom execute goboom_run\n\n")
fmt.Println("Options: ")
flag.PrintDefaults()