From 48f3db8216dcf761f0f722a45c337f21b02336c4 Mon Sep 17 00:00:00 2001 From: Derek Parker Date: Fri, 14 Aug 2015 14:19:09 -0500 Subject: [PATCH] Rename 'run' subcommand to 'debug'. This renaming avoids confusion with the 'run' subcommand in the go tool. The 'run' subcommand in Delve is now deprecated. It is still there, however simply prints a deprecation notice and exits. --- cmd/dlv/main.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/cmd/dlv/main.go b/cmd/dlv/main.go index 07744041..3c11d461 100644 --- a/cmd/dlv/main.go +++ b/cmd/dlv/main.go @@ -54,9 +54,20 @@ The goal of this tool is to provide a simple yet powerful interface for debuggin } rootCommand.AddCommand(versionCommand) - // 'run' subcommand. + // Deprecated 'run' subcommand. runCommand := &cobra.Command{ Use: "run", + Short: "Deprecated command. Use 'debug' instead.", + Run: func(cmd *cobra.Command, args []string) { + fmt.Println("This command is deprecated, please use 'debug' instead.") + os.Exit(0) + }, + } + rootCommand.AddCommand(runCommand) + + // 'debug' subcommand. + debugCommand := &cobra.Command{ + Use: "debug", Short: "Compile and begin debugging program.", Long: `Compiles your program with optimizations disabled, starts and attaches to it, and enables you to immediately begin debugging your program.`, @@ -82,7 +93,7 @@ starts and attaches to it, and enables you to immediately begin debugging your p os.Exit(status) }, } - rootCommand.AddCommand(runCommand) + rootCommand.AddCommand(debugCommand) // 'trace' subcommand. var traceAttachPid int