mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
Crash nicely on no argument.
This commit is contained in:
parent
19e50ec173
commit
8e746386fe
1 changed files with 7 additions and 0 deletions
7
main.go
7
main.go
|
@ -4,6 +4,7 @@ package deno
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
|
"fmt"
|
||||||
"github.com/ry/v8worker2"
|
"github.com/ry/v8worker2"
|
||||||
"os"
|
"os"
|
||||||
"runtime/pprof"
|
"runtime/pprof"
|
||||||
|
@ -69,6 +70,12 @@ var main_map string
|
||||||
func Init() {
|
func Init() {
|
||||||
workerArgs = FlagsParse()
|
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.
|
// Maybe start Golang CPU profiler.
|
||||||
// Use --prof for profiling JS.
|
// Use --prof for profiling JS.
|
||||||
if *flagGoProf != "" {
|
if *flagGoProf != "" {
|
||||||
|
|
Loading…
Add table
Reference in a new issue