Use args passed in to cli Run
This commit is contained in:
parent
7fec8251ce
commit
2624fb35d5
@ -1,7 +1,6 @@
|
|||||||
package cli
|
package cli
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
@ -16,7 +15,7 @@ import (
|
|||||||
|
|
||||||
const historyFile string = ".dbg_history"
|
const historyFile string = ".dbg_history"
|
||||||
|
|
||||||
func Run(run bool, pid int, args ...[]string) {
|
func Run(run bool, pid int, args []string) {
|
||||||
var (
|
var (
|
||||||
dbp *proctl.DebuggedProcess
|
dbp *proctl.DebuggedProcess
|
||||||
err error
|
err error
|
||||||
@ -32,7 +31,7 @@ func Run(run bool, pid int, args ...[]string) {
|
|||||||
}
|
}
|
||||||
defer os.Remove(debugname)
|
defer os.Remove(debugname)
|
||||||
|
|
||||||
dbp, err = proctl.Launch(append([]string{"./" + debugname}, flag.Args()...))
|
dbp, err = proctl.Launch(append([]string{"./" + debugname}, args...))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
die(1, "Could not launch program:", err)
|
die(1, "Could not launch program:", err)
|
||||||
}
|
}
|
||||||
@ -42,7 +41,7 @@ func Run(run bool, pid int, args ...[]string) {
|
|||||||
die(1, "Could not attach to process:", err)
|
die(1, "Could not attach to process:", err)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
dbp, err = proctl.Launch(flag.Args())
|
dbp, err = proctl.Launch(args)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
die(1, "Could not launch program:", err)
|
die(1, "Could not launch program:", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user