Skip to content

invalid argument for flag `--ttr #25

@jpmens

Description

@jpmens

Building beanstool with go version go1.16.3 darwin/amd64 produces the above diagnostic on sundry commands:

$  ./beanstool stats
invalid argument for flag `--ttr' (expected time.Duration): time: missing unit in duration "60"
Usage:
  beanstool [OPTIONS] stats [stats-OPTIONS]
...


$ ./beanstool tail -t default
invalid argument for flag `--ttr' (expected time.Duration): time: missing unit in duration "60"
Usage:
  beanstool [OPTIONS] tail [tail-OPTIONS]

This small patch fixes that for me:

diff --git cli/put.go cli/put.go
index df7eeb1..0a01f5d 100644
--- cli/put.go
+++ cli/put.go
@@ -12,7 +12,7 @@ type PutCommand struct {
 	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"`
+	TTR      time.Duration `short:"" long:"ttr" description:"TTR for the job." default:"60s"`
 
 	Command
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions