From ca6008db64e3401d5c619e2bfdc9eb0714419754 Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Sat, 28 Mar 2020 13:18:15 -0500 Subject: [PATCH] add int16 flag parser --- cmd/command.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/command.go b/cmd/command.go index 91da6b7..4135085 100644 --- a/cmd/command.go +++ b/cmd/command.go @@ -35,6 +35,11 @@ func (f Flags) Float64(name string) float64 { return val } +func (f Flags) Int16(name string) int16 { + val, _ := strconv.ParseInt(f.String(name), 10, 16) + return int16(val) +} + func (f Flags) Bool(name string) bool { val, _ := strconv.ParseBool(f.String(name)) return val