cli: add -noDump flug

This commit is contained in:
z7zmey 2018-06-05 12:22:36 +03:00
parent 22fe72467f
commit 876c5845d9

View File

@ -17,9 +17,11 @@ import (
var wg sync.WaitGroup var wg sync.WaitGroup
var usePhp5 *bool var usePhp5 *bool
var noDump *bool
func main() { func main() {
usePhp5 = flag.Bool("php5", false, "use PHP5 parserWorker") usePhp5 = flag.Bool("php5", false, "use PHP5 parserWorker")
noDump = flag.Bool("noDump", false, "disable dumping to stdout")
flag.Parse() flag.Parse()
pathCh := make(chan string) pathCh := make(chan string)
@ -85,6 +87,7 @@ func printer(result <-chan parser.Parser) {
fmt.Println(e) fmt.Println(e)
} }
if !*noDump {
nsResolver := visitor.NewNamespaceResolver() nsResolver := visitor.NewNamespaceResolver()
parserWorker.GetRootNode().Walk(nsResolver) parserWorker.GetRootNode().Walk(nsResolver)
@ -96,6 +99,7 @@ func printer(result <-chan parser.Parser) {
NsResolver: nsResolver, NsResolver: nsResolver,
} }
parserWorker.GetRootNode().Walk(dumper) parserWorker.GetRootNode().Walk(dumper)
}
wg.Done() wg.Done()
} }
} }