Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add short flags and fix conflicting host flag #24

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cli/bury.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion cli/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions cli/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion cli/kick.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion cli/peek.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
6 changes: 3 additions & 3 deletions cli/put.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion cli/tail.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down