{"record":{"id":"7cd9228bde1ebece","repo":"go-delve/delve","slug":"not-enough-arguments-to-config-debug-info-directo","errorCode":null,"errorMessage":"not enough arguments to \"config debug-info-directories\"","messagePattern":"not enough arguments to \"config debug-info-directories\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/terminal/config.go","lineNumber":165,"sourceCode":"\treturn nil\n}\n\nfunc configureSetDebugInfoDirectories(t *Term, rest string) error {\n\tv := config.Split2PartsBySpace(rest)\n\n\tif t.client != nil {\n\t\tdid, err := t.client.GetDebugInfoDirectories()\n\t\tif err == nil {\n\t\t\tt.conf.DebugInfoDirectories = did\n\t\t}\n\t}\n\n\tswitch v[0] {\n\tcase \"-clear\":\n\t\tt.conf.DebugInfoDirectories = t.conf.DebugInfoDirectories[:0]\n\tcase \"-add\":\n\t\tif len(v) < 2 {\n\t\t\treturn errors.New(\"not enough arguments to \\\"config debug-info-directories\\\"\")\n\t\t}\n\t\tt.conf.DebugInfoDirectories = append(t.conf.DebugInfoDirectories, v[1])\n\tcase \"-rm\":\n\t\tif len(v) < 2 {\n\t\t\treturn errors.New(\"not enough arguments to \\\"config debug-info-directories\\\"\")\n\t\t}\n\t\tfound := false\n\t\tfor i := range t.conf.DebugInfoDirectories {\n\t\t\tif t.conf.DebugInfoDirectories[i] == v[1] {\n\t\t\t\tfound = true\n\t\t\t\tt.conf.DebugInfoDirectories = append(t.conf.DebugInfoDirectories[:i], t.conf.DebugInfoDirectories[i+1:]...)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\treturn fmt.Errorf(\"could not find %q in debug-info-directories\", v[1])\n\t\t}\n\tdefault:","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/terminal/config.go#L147-L183","documentation":"Thrown by configureSetDebugInfoDirectories when the `-add` operation is used without a directory argument. Split2PartsBySpace produced fewer than two tokens, so there is no directory to append to DebugInfoDirectories. It is a strict argument-count guard before mutating the configuration.","triggerScenarios":"Running `config debug-info-directories -add` with no path following it in the Delve CLI (e.g. `config` line `debug-info-directories -add`).","commonSituations":"Users copy only the flag from documentation and forget the path; an editor or script truncates the line; paths are expected to be filled in by a variable that ends up empty.","solutions":["Supply the directory: `config debug-info-directories -add /path/to/dir`.","Quote paths containing spaces: `config debug-info-directories -add \"/path with spaces\"`.","Use `config debug-info-directories` with no arguments to list the current directories and verify state."],"exampleFix":"// before\nconfig debug-info-directories -add\n// after\nconfig debug-info-directories -add /usr/local/go/src","handlingStrategy":"validation","validationCode":"v := config.Split2PartsBySpace(rest)\nif v[0] == \"-add\" && len(v) < 2 {\n    return errors.New(\"-add requires a directory argument\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always follow -add with an explicit directory path","Quote directories containing spaces","Verify current dirs with bare `config debug-info-directories` before editing"],"tags":["cli","configuration","argument-count"],"backgroundTag":"wrong-number-of-arguments","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}