diff options
| author | Jeff Carr <[email protected]> | 2025-10-03 11:26:50 -0500 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-03 11:26:50 -0500 | 
| commit | c0544ed4a139ba47bd879a2405bfa73e4c10328a (patch) | |
| tree | 7199d5cdfd1308a79b682505e39f6fa3753777be | |
| parent | 82cc40997fa54e5500670e2f5151b706436c1245 (diff) | |
| -rw-r--r-- | Makefile | 10 | ||||
| -rw-r--r-- | argv.go | 10 | ||||
| -rw-r--r-- | main.go | 2 | 
3 files changed, 13 insertions, 9 deletions
@@ -1,7 +1,7 @@  .PHONY: debian  VERSION = $(shell git describe --tags) -DATE = $(shell date +%Y.%m.%d) +BUILDTIME = $(shell date +%s)  run: clean goimports vet install  	go-deb --gui andlabs gui @@ -21,12 +21,12 @@ auto-build: build  build: goimports vet  	-rm resources/*.so  	touch resources/blank.so -	GO111MODULE="off" go build -v \ -		    -ldflags "-X main.VERSION=${VERSION} -X main.DATE=${DATE} -X gui.GUIVERSION=${VERSION}" +	GO111MODULE=off go build -v -x \ +		-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"  install: goimports -	GO111MODULE="off" go install -v \ -		    -ldflags "-X main.VERSION=${VERSION} -X main.DATE=${DATE} -X gui.GUIVERSION=${VERSION}" +	GO111MODULE=off go install \ +		-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"  goimports:  	goimports -w *.go @@ -26,7 +26,7 @@ type args struct {  }  func (args) Version() string { -	return "go-clone " + VERSION + "    Built on " + DATE +	return "go-clone " + VERSION + "    Built on " + BUILDTIME  }  type EmptyCmd struct { @@ -49,11 +49,15 @@ func (args) Appname() string {  	return ARGNAME  } +func (args) Buildtime() (string, string) { +	return BUILDTIME, VERSION +} +  func (a args) DoAutoComplete(pb *prep.Auto) {  	if pb.Cmd == "" { -		pb.Autocomplete3([]string{"arch", "build", "gui", "show"}) +		pb.Autocomplete3([]string{"arch", "build", "gui", "show", "--version"})  	} else { -		pb.SubCommand(pb.Argv...) +		pb.SubCommand(pb.Goargs...)  	}  	os.Exit(0)  } @@ -13,7 +13,7 @@ import (  // sent from -ldflags  var VERSION string -var DATE string +var BUILDTIME string  //go:embed resources/*  var resources embed.FS  | 
