if not have file arg, will print usage

This commit is contained in:
blurbird 2019-03-07 04:28:15 +08:00
parent 32d9c634d1
commit 3d41f036da

View File

@ -44,6 +44,11 @@ func main() {
flag.Parse() flag.Parse()
if len(flag.Args()) == 0{
flag.Usage()
return
}
switch profiler { switch profiler {
case "cpu": case "cpu":
defer profile.Start(profile.ProfilePath("."), profile.NoShutdownHook).Stop() defer profile.Start(profile.ProfilePath("."), profile.NoShutdownHook).Stop()