This commit is contained in:
Martin Lees 2019-12-12 17:31:41 +01:00
parent 06eb576eaa
commit c62d7736ea
3 changed files with 7 additions and 6 deletions

View File

@ -22,7 +22,7 @@ type Float64Flag struct {
} }
// IsSet returns whether or not the flag has been set through env or file // 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 return f.HasBeenSet
} }

View File

@ -25,6 +25,7 @@ func (t *Timestamp) SetTimestamp(value time.Time) {
t.hasBeenSet = true t.hasBeenSet = true
} }
} }
// Set the timestamp string layout for future parsing // Set the timestamp string layout for future parsing
func (t *Timestamp) SetLayout(layout string) { func (t *Timestamp) SetLayout(layout string) {
t.layout = layout t.layout = layout

View File

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