// QuantityFlag is a helper that makes a quantity flag (using standard flag package). // Will panic if defaultValue is not a valid quantity. func QuantityFlag(flagName, defaultValue, description string) *Quantity { q := MustParse(defaultValue) flag.Var(NewQuantityFlagValue(&q), flagName, description) return &q }
func VersionVar(p *versionValue, name string, value versionValue, usage string) { *p = value flag.Var(p, name, usage) }