From f6fd580a0e597de23f0eab351e8d2fdfcfb520e2 Mon Sep 17 00:00:00 2001 From: Victor Häggqvist Date: Mon, 28 Mar 2016 00:41:14 +0200 Subject: use my pflag and goxc --- .gitignore | 27 +++++++++++++++++++++++++++ Godeps/Godeps.json | 10 +++++----- Makefile | 18 +++++++++++------- docs/_build/man/goboom.1 | 2 +- goboom.go | 8 ++++---- 5 files changed, 48 insertions(+), 17 deletions(-) create mode 100644 .gitignore 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() -- cgit v1.2.3