diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-05-29 06:30:16 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-05-29 06:30:16 -0400 |
commit | 8e746386fe4777c9d932e870ea156bf10d446b3b (patch) | |
tree | 70ad03723dae7815306ef0bf2018bf47c4f1700d /main.go | |
parent | 19e50ec173d17d012ba6b3eb239c6b361fea6e04 (diff) |
Crash nicely on no argument.
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -4,6 +4,7 @@ package deno import ( "flag" + "fmt" "github.com/ry/v8worker2" "os" "runtime/pprof" @@ -69,6 +70,12 @@ var main_map string func Init() { workerArgs = FlagsParse() + if len(workerArgs) == 0 { + fmt.Fprintf(os.Stderr, "Usage: %s file.ts\n", os.Args[0]) + flag.PrintDefaults() + os.Exit(1) + } + // Maybe start Golang CPU profiler. // Use --prof for profiling JS. if *flagGoProf != "" { |