master
Bel LaPointe 2020-12-04 12:55:06 -07:00
parent 853960e754
commit 2bf49d7b3c
1 changed files with 12 additions and 0 deletions

View File

@ -26,6 +26,18 @@ func NewArgSet(configFiles ...string) *ArgSet {
} }
} }
func (as *ArgSet) String() string {
s := "{"
for _, arg := range as.args {
if len(s) > 2 {
s += ", "
}
s += fmt.Sprintf("%s:%v", arg.Flag, arg.Value)
}
s += "}"
return s
}
func (as *ArgSet) Append(argType Type, key, help string, def interface{}) { func (as *ArgSet) Append(argType Type, key, help string, def interface{}) {
as.args = append(as.args, NewArg(argType, key, help, def)) as.args = append(as.args, NewArg(argType, key, help, def))
} }