mirror of
https://github.com/thegeeklab/git-sv.git
synced 2024-11-24 01:00:39 +00:00
feat: add version on command usage
This commit is contained in:
parent
c834806367
commit
0deb04cc9c
4
Makefile
4
Makefile
@ -10,10 +10,12 @@ BIN = git-sv
|
||||
|
||||
ECHOFLAGS ?=
|
||||
|
||||
VERSION ?=
|
||||
|
||||
BUILDOS ?= linux
|
||||
BUILDARCH ?= amd64
|
||||
BUILDENVS ?= CGO_ENABLED=0 GOOS=$(BUILDOS) GOARCH=$(BUILDARCH)
|
||||
BUILDFLAGS ?= -a -installsuffix cgo --ldflags '-extldflags "-lm -lstdc++ -static"'
|
||||
BUILDFLAGS ?= -a -installsuffix cgo --ldflags '-X main.Version=$(VERSION) -extldflags "-lm -lstdc++ -static"'
|
||||
|
||||
usage: Makefile
|
||||
@echo $(ECHOFLAGS) "to use make call:"
|
||||
|
@ -8,6 +8,9 @@ import (
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
// Version for git-sv
|
||||
var Version = ""
|
||||
|
||||
func main() {
|
||||
cfg := loadConfig()
|
||||
|
||||
@ -17,6 +20,7 @@ func main() {
|
||||
|
||||
app := cli.NewApp()
|
||||
app.Name = "sv"
|
||||
app.Version = Version
|
||||
app.Usage = "semantic version for git"
|
||||
app.Commands = []cli.Command{
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user