Skip to content

Commit

Permalink
Crash nicely on no argument.
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed May 29, 2018
1 parent 19e50ec commit 8e74638
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package deno

import (
"flag"
"fmt"
"github.com/ry/v8worker2"
"os"
"runtime/pprof"
Expand Down Expand Up @@ -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 != "" {
Expand Down

0 comments on commit 8e74638

Please sign in to comment.