提交 7f17a2fd 编写于 作者: M Michael Gehring

Remove the -proc option and make it the default

上级 20290015
......@@ -33,7 +33,7 @@ The debugger can be launched in three ways:
* Provide the name of the program you want to debug, and the debugger will launch it for you.
```
$ dlv -proc path/to/program
$ dlv path/to/program
```
* Provide the pid of a currently running process, and the debugger will attach and begin the session.
......
......@@ -33,7 +33,6 @@ func main() {
var (
pid int
proc string
run bool
printv bool
err error
......@@ -43,12 +42,11 @@ func main() {
)
flag.IntVar(&pid, "pid", 0, "Pid of running process to attach to.")
flag.StringVar(&proc, "proc", "", "Path to process to run and debug.")
flag.BoolVar(&run, "run", false, "Compile program and begin debug session.")
flag.BoolVar(&printv, "v", false, "Print version number and exit.")
flag.Parse()
if flag.NFlag() == 0 {
if flag.NFlag() == 0 && len(flag.Args()) == 0 {
flag.Usage()
os.Exit(0)
}
......@@ -77,8 +75,8 @@ func main() {
if err != nil {
die(1, "Could not attach to process:", err)
}
case proc != "":
dbgproc, err = proctl.Launch(append([]string{proc}, flag.Args()...))
default:
dbgproc, err = proctl.Launch(flag.Args())
if err != nil {
die(1, "Could not launch program:", err)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册