-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.go
36 lines (30 loc) · 665 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Command tss prints timestamps relative to the program start, and the previous
// line of input.
package main
import (
"flag"
"fmt"
"log"
"os"
tss "github.com/kevinburke/tss/lib"
)
func init() {
flag.Usage = func() {
fmt.Fprintf(os.Stderr, `tss [-v] [-h]
Annotate stdin with timestamps per line.
`)
}
}
const Version = "1.3"
func main() {
version := flag.Bool("version", false, "Print the version string")
v := flag.Bool("v", false, "Print the version string")
flag.Parse()
if *version || *v {
fmt.Fprintf(os.Stderr, "tss version %s\n", Version)
os.Exit(2)
}
if _, err := tss.Copy(os.Stdout, os.Stdin); err != nil {
log.Fatal(err)
}
}