From f04e26523189ac3fc54381376966f98d2f52440b Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Fri, 22 Jul 2022 18:25:56 +0200 Subject: add spam command to sigsum-debug --- internal/options/options.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'internal/options/options.go') diff --git a/internal/options/options.go b/internal/options/options.go index 8e4ab0c..d6cbd70 100644 --- a/internal/options/options.go +++ b/internal/options/options.go @@ -3,6 +3,7 @@ package options import ( "flag" "fmt" + "time" ) const ( @@ -42,6 +43,12 @@ func AddUint64(fs *flag.FlagSet, opt *uint64, short, long string, value uint64) fs.Uint64Var(opt, long, value, "") } +// AddDuration adds a duration option to a flag set +func AddDuration(fs *flag.FlagSet, opt *time.Duration, short, long string, value time.Duration) { + fs.DurationVar(opt, short, value, "") + fs.DurationVar(opt, long, value, "") +} + // CheckString checks that a string option has a non-default value func CheckString(optionName, value string, err error) error { if err != nil { -- cgit v1.2.3