Martin Lees 4 years ago
parent 06eb576eaa
commit c62d7736ea

@ -18,11 +18,11 @@ type Float64Flag struct {
Value float64
DefaultText string
Destination *float64
HasBeenSet bool
HasBeenSet bool
}
// IsSet returns whether or not the flag has been set through env or file
func (f *Float64Flag)IsSet() bool {
func (f *Float64Flag) IsSet() bool {
return f.HasBeenSet
}

@ -8,9 +8,9 @@ import (
// Timestamp wrap to satisfy golang's flag interface.
type Timestamp struct {
timestamp *time.Time
timestamp *time.Time
hasBeenSet bool
layout string
layout string
}
// Timestamp constructor
@ -25,6 +25,7 @@ func (t *Timestamp) SetTimestamp(value time.Time) {
t.hasBeenSet = true
}
}
// Set the timestamp string layout for future parsing
func (t *Timestamp) SetLayout(layout string) {
t.layout = layout
@ -66,7 +67,7 @@ type TimestampFlag struct {
FilePath string
Required bool
Hidden bool
Layout string
Layout string
Value *Timestamp
DefaultText string
HasBeenSet bool

@ -138,7 +138,7 @@ func printFlagSuggestions(lastArg string, flags []Flag, writer io.Writer) {
if bflag, ok := flag.(*BoolFlag); ok && bflag.Hidden {
continue
}
for _, name := range flag.Names(){
for _, name := range flag.Names() {
name = strings.TrimSpace(name)
// this will get total count utf8 letters in flag name
count := utf8.RuneCountInString(name)

Loading…
Cancel
Save