diff --git a/main.go b/main.go index e9ed7bbc..ebbf7469 100644 --- a/main.go +++ b/main.go @@ -16,6 +16,8 @@ import ( "github.com/derekparker/delve/proctl" ) +const version string = "0.1.0.beta" + type term struct { stdin *bufio.Reader } @@ -32,6 +34,7 @@ func main() { pid int proc string run bool + printv bool err error dbgproc *proctl.DebuggedProcess t = newTerm() @@ -41,6 +44,7 @@ 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 { @@ -48,6 +52,11 @@ func main() { os.Exit(0) } + if printv { + fmt.Printf("Delve version: %s\n", version) + os.Exit(0) + } + start := func(name string) *proctl.DebuggedProcess { proc := exec.Command(name) proc.Stdout = os.Stdout