{"record":{"id":"41ecf4fc81db795a","repo":"go-delve/delve","slug":"wrong-argument-to-config-debug-info-directories","errorCode":null,"errorMessage":"wrong argument to \"config debug-info-directories\"","messagePattern":"wrong argument to \"config debug-info-directories\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/terminal/config.go","lineNumber":184,"sourceCode":"\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:\n\t\treturn errors.New(\"wrong argument to \\\"config debug-info-directories\\\"\")\n\t}\n\n\tif t.client != nil {\n\t\tt.client.SetDebugInfoDirectories(t.conf.DebugInfoDirectories)\n\t}\n\treturn nil\n}\n","sourceCodeStart":166,"sourceCodeEnd":192,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/terminal/config.go#L166-L192","documentation":"Thrown by configureSetDebugInfoDirectories when the first argument is not one of the recognized operations `-clear`, `-add`, or `-rm`. The command's switch statement hits its default branch because the operation name is misspelled or an unsupported value was passed.","triggerScenarios":"Running e.g. `config debug-info-directories --add /path` (double dash), `-Add` (wrong case), `add /path` (missing dash), or `-list` (not a supported subcommand).","commonSituations":"Users assuming GNU-style double-dash flags; expecting a listing/list subcommand; typos like `-ad` or `-remove`.","solutions":["Use the exact flags: `-clear`, `-add <dir>`, or `-rm <dir>`, each with a single leading dash.","Fix case sensitivity: `-add` not `-Add`.","To view directories, run `config debug-info-directories` with no arguments rather than guessing a `-list` flag."],"exampleFix":"// before\nconfig debug-info-directories --add /usr/local/go/src\n// after\nconfig debug-info-directories -add /usr/local/go/src","handlingStrategy":"validation","validationCode":"allowed := map[string]bool{\"-clear\": true, \"-add\": true, \"-rm\": true}\nif !allowed[op] {\n    return fmt.Errorf(\"unknown op %q; use -clear, -add, or -rm\", op)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use single-dash flags exactly: -clear, -add, -rm (not --add, not add)","Remember there is no -list flag; bare command lists directories","Check case: flags are lowercase"],"tags":["cli","configuration","invalid-argument"],"backgroundTag":"invalid-flag-or-argument","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}