{"record":{"id":"7db5030332588a25","repo":"go-delve/delve","slug":"unrecognized-argument-to-s-s","errorCode":null,"errorMessage":"unrecognized argument to %s %s","messagePattern":"unrecognized argument to (.+?) (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/api/command.go","lineNumber":145,"sourceCode":"\t}\n\n\tswitch args[i] {\n\tcase \"curloc\":\n\t\treturn GoroutineCurrentLoc, nil\n\tcase \"userloc\":\n\t\treturn GoroutineUserLoc, nil\n\tcase \"goloc\":\n\t\treturn GoroutineGoLoc, nil\n\tcase \"startloc\":\n\t\treturn GoroutineStartLoc, nil\n\tcase \"label\":\n\t\treturn GoroutineLabel, nil\n\tcase \"running\":\n\t\treturn GoroutineRunning, nil\n\tcase \"user\":\n\t\treturn GoroutineUser, nil\n\tdefault:\n\t\treturn GoroutineFieldNone, fmt.Errorf(\"unrecognized argument to %s %s\", args[i-1], args[i])\n\t}\n}\n\nfunc readGoroutinesFilter(args []string, pi *int) (*ListGoroutinesFilter, error) {\n\tr := new(ListGoroutinesFilter)\n\tvar err error\n\tr.Kind, err = readGoroutinesFilterKind(args, *pi+1)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t*pi++\n\tswitch r.Kind {\n\tcase GoroutineRunning, GoroutineUser:\n\t\treturn r, nil\n\t}\n\tif *pi+1 >= len(args) {\n\t\treturn nil, fmt.Errorf(\"%s %s needs to be followed by an expression\", args[*pi-1], args[*pi])\n\t}","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/service/api/command.go#L127-L163","documentation":"readGoroutinesFilterKind maps a filter kind token to a GoroutineField. Tokens other than the recognized kinds (curloc, userloc, label, function, running, user, file, line) are rejected with this error, echoing both the flag and the offending token.","triggerScenarios":"Calling ParseGoroutineArgs with a filter flag followed by an invalid kind, e.g. 'goroutines -with state running' or 'goroutines -without loc main.go:10'.","commonSituations":"Using synonym words the parser does not know (e.g. 'name', 'location', 'status'); case-sensitivity mistakes ('Curloc'); confusion between the filter kind and the filter value.","solutions":["Replace the kind with one of: curloc, userloc, label, function, running, user, file, line.","Remember that 'running' and 'user' take no expression; other kinds need a following expression.","Fix capitalization - kinds are lowercase."],"exampleFix":"// before\ncmd.ProcessLine(\"goroutines -with status running\")\n// after\ncmd.ProcessLine(\"goroutines -with running\")","handlingStrategy":"validation","validationCode":"var validKinds = map[string]bool{\"curloc\": true, \"userloc\": true, \"label\": true, \"function\": true, \"running\": true, \"user\": true, \"file\": true, \"line\": true}\n// validate kind token before building the arg list\nif !validKinds[kind] { return fmt.Errorf(\"kind %q not supported\", kind) }","typeGuard":null,"tryCatchPattern":"if _, err := api.ParseGoroutineArgs([]string{\"-with\", kind}); err != nil {\n\treturn fmt.Errorf(\"invalid filter kind: %v\", err)\n}","preventionTips":["Only use lowercase kind names from the switch in readGoroutinesFilterKind","Remember 'running' and 'user' take no value","Check spelling against the documented set"],"tags":["cli","argument-parsing","delve"],"backgroundTag":"invalid-enum-value","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}