aboutsummaryrefslogtreecommitdiff
path: root/internal/ctflag/ctflag.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/ctflag/ctflag.go')
-rw-r--r--internal/ctflag/ctflag.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/ctflag/ctflag.go b/internal/ctflag/ctflag.go
index 1309afd..cf8d7db 100644
--- a/internal/ctflag/ctflag.go
+++ b/internal/ctflag/ctflag.go
@@ -31,6 +31,7 @@ package ctflag
import (
"flag"
"fmt"
+ "time"
)
// NewFlagSet outputs a new flag set that continues on errors without standard
@@ -77,6 +78,12 @@ func Uint64(fs *flag.FlagSet, opt *uint64, short, long string, value uint64) {
fs.Uint64Var(opt, long, value, "")
}
+// Duration adds a new duration option to a flag set
+func Duration(fs *flag.FlagSet, opt *time.Duration, short, long string, value time.Duration) {
+ fs.DurationVar(opt, short, value, "")
+ fs.DurationVar(opt, long, value, "")
+}
+
// Bool adds a new bool option to a flag set
func Bool(fs *flag.FlagSet, opt *bool, short, long string, value bool) {
fs.BoolVar(opt, short, value, "")