Skip to content

Commit dc2ba7e

Browse files
committed
Fixed -plain template
1 parent 12fbfe0 commit dc2ba7e

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = 2.0.0
1+
VERSION = 2.0.1
22

33
PACKAGES := $(shell go list -f {{.Dir}} ./...)
44
GOFILES := $(addsuffix /*.go,$(PACKAGES))

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Or [download the binary](https://github.com/sgreben/ts/releases) from the releas
1919
```text
2020
Usage of ts:
2121
-plain
22-
-template='{{.Time}} +{{.DeltaNanos}} {{.Text}}'
22+
-template='{{.TimeString}} +{{.DeltaNanos}} {{.Text}}'
2323
-start string
2424
a regex pattern. if given, only lines matching it (re)start the stopwatch
2525
-template string

cmd/ts/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ var start *regexp.Regexp
9393
func init() {
9494
flag.StringVar(&config.template, "template", "", "go template (https://golang.org/pkg/text/template)")
9595
flag.StringVar(&config.timeFormat, "timeformat", "RFC3339", timeFormatsHelp())
96-
flag.BoolVar(&config.plain, "plain", false, "-template='{{.Time}} +{{.DeltaNanos}} {{.Text}}'")
96+
flag.BoolVar(&config.plain, "plain", false, "-template='{{.TimeString}} +{{.DeltaNanos}} {{.Text}}'")
9797
flag.StringVar(&config.start, "start", "", "a regex pattern. if given, only lines matching it (re)start the stopwatch")
9898
flag.Parse()
9999
if knownFormat, ok := timeFormats[config.timeFormat]; ok {
100100
config.timeFormat = knownFormat
101101
}
102102
if config.plain {
103-
config.template = "{{.Time}} +{{.DeltaNanos}} {{.Text}}"
103+
config.template = "{{.TimeString}} +{{.DeltaNanos}} {{.Text}}"
104104
}
105105
if config.template != "" {
106106
printer = templatePrinter(config.template)

0 commit comments

Comments
 (0)