diff options
Diffstat (limited to 'internal/flagopt')
-rw-r--r-- | internal/flagopt/flagopt.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/internal/flagopt/flagopt.go b/internal/flagopt/flagopt.go new file mode 100644 index 0000000..484270d --- /dev/null +++ b/internal/flagopt/flagopt.go @@ -0,0 +1,26 @@ +package flagopt + +import ( + "flag" + "time" +) + +func BoolOpt(fs *flag.FlagSet, opt *bool, short, long string, value bool) { + fs.BoolVar(opt, short, value, "") + fs.BoolVar(opt, long, value, "") +} + +func DurationOpt(fs *flag.FlagSet, opt *time.Duration, short, long string, value time.Duration) { + fs.DurationVar(opt, short, value, "") + fs.DurationVar(opt, long, value, "") +} + +func UintOpt(fs *flag.FlagSet, opt *uint, short, long string, value uint) { + fs.UintVar(opt, short, value, "") + fs.UintVar(opt, long, value, "") +} + +func StringOpt(fs *flag.FlagSet, opt *string, short, long, value string) { + fs.StringVar(opt, short, value, "") + fs.StringVar(opt, long, value, "") +} |