diff options
author | Rasmus Dahlberg <rasmus@mullvad.net> | 2022-07-22 18:25:56 +0200 |
---|---|---|
committer | Rasmus Dahlberg <rasmus@mullvad.net> | 2022-07-22 18:25:56 +0200 |
commit | f04e26523189ac3fc54381376966f98d2f52440b (patch) | |
tree | 52f664a52759322947420f7313573e92002fa6f9 /internal/options | |
parent | 722e48feb2aa85d8cb75069a06024e506367e34f (diff) |
add spam command to sigsum-debugsigsum-spam
Diffstat (limited to 'internal/options')
-rw-r--r-- | internal/options/options.go | 7 |
1 files changed, 7 insertions, 0 deletions
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 { |