1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/builder/dockerfile/parser/dumper/main.go
Daniel Nephin 9c53fa2d0c Cleanup processing of directives.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-04-12 15:42:35 -04:00

32 lines
442 B
Go

package main
import (
"fmt"
"os"
"github.com/docker/docker/builder/dockerfile/parser"
)
func main() {
var f *os.File
var err error
if len(os.Args) < 2 {
fmt.Println("please supply filename(s)")
os.Exit(1)
}
for _, fn := range os.Args[1:] {
f, err = os.Open(fn)
if err != nil {
panic(err)
}
defer f.Close()
result, err := parser.Parse(f)
if err != nil {
panic(err)
}
fmt.Println(result.AST.Dump())
}
}