stamp.go: rename flag 'precise' to 'nano'

This commit is contained in:
gutmet 2020-10-21 20:02:14 +02:00
parent 0291eb2e1d
commit 2f194d1750

View File

@ -16,7 +16,7 @@ const (
type flags struct { type flags struct {
utc bool utc bool
filename bool filename bool
precise bool nano bool
} }
func stamp(format string, f *flags) string { func stamp(format string, f *flags) string {
@ -34,7 +34,7 @@ func getFormat(f *flags) string {
} else { } else {
format = defaultFormat format = defaultFormat
} }
if f.precise { if f.nano {
format += ".000000000" format += ".000000000"
} }
return format return format
@ -44,7 +44,7 @@ func main() {
f := flags{} f := flags{}
flag.BoolVar(&f.utc, "utc", false, "use UTC instead of local time") flag.BoolVar(&f.utc, "utc", false, "use UTC instead of local time")
flag.BoolVar(&f.filename, "filename", false, "use filename friendly format") flag.BoolVar(&f.filename, "filename", false, "use filename friendly format")
flag.BoolVar(&f.precise, "precise", false, "include nanoseconds") flag.BoolVar(&f.nano, "nano", false, "include nanoseconds")
flag.Parse() flag.Parse()
format := getFormat(&f) format := getFormat(&f)