diff --git a/Makefile b/Makefile index c77be04..56f6751 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ DEPENDENCIES = BASE_PATH := $(shell pwd) BUILD_PATH := $(BASE_PATH)/build VERSION ?= $(shell git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/') -BUILD ?= $(shell date) +BUILD ?= $(shell date --utc --rfc-3339=seconds | tr ' ' 'T') ASSETS := static # PACKAGES @@ -27,7 +27,7 @@ all: test build build: dependencies for cmd in $(COMMANDS); do \ - $(GOCMD) build -ldflags "-X main.version $(VERSION) -X main.build \"$(BUILD)\"" $${cmd}.go; \ + $(GOCMD) build -ldflags "-X main.version=$(VERSION) -X main.build=$(BUILD)" $${cmd}.go; \ done test: dependencies diff --git a/cli/bury.go b/cli/bury.go index 5ea8da9..a3d1bd0 100644 --- a/cli/bury.go +++ b/cli/bury.go @@ -10,7 +10,7 @@ import ( type BuryCommand struct { Tube string `short:"t" long:"tube" description:"tube to bury jobs in." required:"true"` - Num int `short:"" long:"num" description:"number of jobs to bury."` + Num int `short:"n" long:"num" description:"number of jobs to bury."` Command } diff --git a/cli/command.go b/cli/command.go index cd41a4b..52a95e4 100644 --- a/cli/command.go +++ b/cli/command.go @@ -11,7 +11,7 @@ var TitleStyle = gocolorize.NewColor("green") var InfoStyle = gocolorize.NewColor("yellow") type Command struct { - Host string `short:"h" long:"host" description:"beanstalkd host addr." required:"true" default:"localhost:11300"` + Host string `short:"H" long:"host" description:"beanstalkd host addr." required:"true" default:"localhost:11300"` conn *beanstalk.Conn } diff --git a/cli/delete.go b/cli/delete.go index 877e313..6a4b7d2 100644 --- a/cli/delete.go +++ b/cli/delete.go @@ -6,9 +6,9 @@ import ( type DeleteCommand struct { Tube string `short:"t" long:"tube" description:"tube to be delete." required:"true"` - State string `short:"" long:"state" description:"peek from 'buried', 'ready' or 'delayed' queues." default:"buried"` - Print bool `short:"" long:"print" description:"prints the jobs after delete it."` - Empty bool `short:"" long:"empty" description:"delete all jobs with the given status in the given tube."` + State string `short:"s" long:"state" description:"peek from 'buried', 'ready' or 'delayed' queues." default:"buried"` + Print bool `short:"p" long:"print" description:"prints the jobs after delete it."` + Empty bool `short:"e" long:"empty" description:"delete all jobs with the given status in the given tube."` Command } diff --git a/cli/kick.go b/cli/kick.go index a2fdb86..ed8622b 100644 --- a/cli/kick.go +++ b/cli/kick.go @@ -8,7 +8,7 @@ import ( type KickCommand struct { Tube string `short:"t" long:"tube" description:"tube to kick jobs in." required:"true"` - Num int `short:"" long:"num" description:"number of jobs to kick."` + Num int `short:"n" long:"num" description:"number of jobs to kick."` Command } diff --git a/cli/peek.go b/cli/peek.go index 7fb1fdb..344fcfa 100644 --- a/cli/peek.go +++ b/cli/peek.go @@ -6,7 +6,7 @@ import ( type PeekCommand struct { Tube string `short:"t" long:"tube" description:"tube to be tailed." required:"true"` - State string `short:"" long:"state" description:"peek from 'buried', 'ready' or 'delayed' queues." default:"buried"` + State string `short:"s" long:"state" description:"peek from 'buried', 'ready' or 'delayed' queues." default:"buried"` Command } diff --git a/cli/put.go b/cli/put.go index df7eeb1..d2c143c 100644 --- a/cli/put.go +++ b/cli/put.go @@ -10,9 +10,9 @@ import ( type PutCommand struct { Tube string `short:"t" long:"tube" description:"tube to be tailed." required:"true"` Body string `short:"b" long:"body" description:"plain text data for the job." required:"true"` - Priority uint32 `short:"" long:"priority" description:"priority for the job." default:"1024"` - Delay time.Duration `short:"" long:"delay" description:"delay for the job." default:"0"` - TTR time.Duration `short:"" long:"ttr" description:"TTR for the job." default:"60"` + Priority uint32 `short:"p" long:"priority" description:"priority for the job." default:"1024"` + Delay time.Duration `short:"d" long:"delay" description:"delay for the job." default:"0"` + TTR time.Duration `short:"" long:"ttr" description:"TTR for the job." default:"60s"` Command } diff --git a/cli/tail.go b/cli/tail.go index a1f2c8d..fe018bf 100644 --- a/cli/tail.go +++ b/cli/tail.go @@ -13,7 +13,7 @@ var TooManyErrorsError = errors.New("Too many errors") type TailCommand struct { Tube string `short:"t" long:"tube" description:"tube to be tailed." required:"true"` - Action string `short:"" long:"action" description:"action to perform after reserver the job. (release, bury, delete)" default:"release"` + Action string `short:"a" long:"action" description:"action to perform after reserving the job. (release, bury, delete)" default:"release"` Command }