summaryrefslogtreecommitdiff
path: root/src/main.go
blob: ec3b14b82e84ed00a65a93867fe63b3a3e9162ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package main

import "fmt"
import "tparse"
import "flag"
import "os"

func main() {
	inputFile := flag.String("in", "", "The file to parse")
	outputFile := flag.String("out", "out.tnp", "The file to store the parse in")

	flag.Parse()

	fd, err := os.Create(*outputFile)

	if err != nil {
		fmt.Println(err.Error())
		return
	}

	fd.WriteString(fmt.Sprint(tparse.ParseFile(*inputFile)))

	fd.Close()
}