{"record":{"id":"67b40b2ea5eae8a7","repo":"go-delve/delve","slug":"not-enough-arguments-for-target","errorCode":null,"errorMessage":"not enough arguments for 'target'","messagePattern":"not enough arguments for 'target'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/terminal/command.go","lineNumber":3600,"sourceCode":"\t\t\treturn err\n\t\t}\n\t\tpid, err := strconv.Atoi(argv[1])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfound := false\n\t\tfor _, tgt := range tgts {\n\t\t\tif tgt.Pid == pid {\n\t\t\t\tfound = true\n\t\t\t\tt.client.SwitchThread(tgt.CurrentThread.ID)\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\treturn fmt.Errorf(\"could not find target %d\", pid)\n\t\t}\n\t\treturn nil\n\tcase \"\":\n\t\treturn errors.New(\"not enough arguments for 'target'\")\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown command 'target %s'\", argv[0])\n\t}\n}\n\nfunc formatBreakpointName(bp *api.Breakpoint, upcase bool) string {\n\tthing := \"breakpoint\"\n\tif bp.Tracepoint {\n\t\tthing = \"tracepoint\"\n\t}\n\tif bp.WatchExpr != \"\" {\n\t\tthing = \"watchpoint\"\n\t}\n\tif upcase {\n\t\tthing = strings.ToUpper(string(thing[0])) + thing[1:]\n\t}\n\tid := bp.Name\n\tif id == \"\" {","sourceCodeStart":3582,"sourceCodeEnd":3618,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/terminal/command.go#L3582-L3618","documentation":"The 'target' terminal command dispatches on its first argument (subcommand). With no subcommand at all (bare 'target'), it returns this error. Valid subcommands include e.g. listing targets and 'follow-exec'.","triggerScenarios":"Running 'target' with no arguments, so the switch matches the empty-string case.","commonSituations":"Users expecting a bare 'target' to list all debugged processes, or pressing the command before completing it.","solutions":["Provide a subcommand, e.g. 'target list' to show all targets, or 'target follow-exec ...'.","Run 'help target' to see the available subcommands.","If you wanted the current target information, use the appropriate subcommand rather than bare 'target'."],"exampleFix":"// before\ntarget\n// after\ntarget list","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(cmdline) == \"target\" { return errors.New(\"target requires a subcommand, e.g. 'target list'\") }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include a subcommand after 'target'.","Use 'target list' to enumerate debugged processes.","Run 'help target' to discover valid subcommands."],"tags":["cli","missing-argument","delve"],"backgroundTag":"missing-command-argument","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}