package main import ( "fmt" "os" "git.thomasvoss.com/gsp/formatter" "git.thomasvoss.com/gsp/parser" ) func main() { if len(os.Args) != 2 { fmt.Fprintf(os.Stderr, "Usage: %s file\n", os.Args[0]) os.Exit(1) } file, err := os.Open(os.Args[1]) if err != nil { die(err) } defer file.Close() ast, err := parser.ParseFile(file) if err != nil { die(err) } formatter.PrintHtml(ast) fmt.Print("\n") } func die(e error) { fmt.Fprintf(os.Stderr, "%s: %s\n", os.Args[0], e) os.Exit(1) }