{"record":{"id":"2ab62bd347b8b94a","repo":"go-delve/delve","slug":"unknown-argument-q-to-exit","errorCode":null,"errorMessage":"unknown argument %q to exit","messagePattern":"unknown argument %q to exit","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/terminal/command.go","lineNumber":3182,"sourceCode":"\t\tfor _, bp := range bps {\n\t\t\tif bp.ID >= 0 {\n\t\t\t\thasUserBreakpoints = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif hasUserBreakpoints {\n\t\t\tyes, _ := yesno(t.line, \"There are breakpoints set, do you wish to quit and continue without clearing breakpoints? [Y/n] \", \"yes\")\n\t\t\tif !yes {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tt.quitContinue = true\n\tcase \"-d\":\n\t\tt.detachNoKill = true\n\tcase \"\":\n\t\t// no arguments\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown argument %q to exit\", args)\n\t}\n\treturn ExitRequestError{}\n}\n\nfunc getBreakpointByIDOrName(t *Term, arg string) (*api.Breakpoint, error) {\n\tif id, err := strconv.Atoi(arg); err == nil {\n\t\treturn t.client.GetBreakpoint(id)\n\t}\n\treturn t.client.GetBreakpointByName(arg)\n}\n\nfunc (c *Commands) onCmd(t *Term, ctx callContext, argstr string) error {\n\targs := config.Split2PartsBySpace(argstr)\n\n\tif len(args) < 2 {\n\t\treturn errors.New(\"not enough arguments\")\n\t}\n","sourceCodeStart":3164,"sourceCodeEnd":3200,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/terminal/command.go#L3164-L3200","documentation":"The `exit` command accepts only a small set of options (`-c` to continue, `-d` to detach without killing, or none). Any other argument reaches the default case and is rejected with this message; ExitRequestError is never returned, so the debugger session does not exit.","triggerScenarios":"Typing `exit now`, `exit -q`, or any flag other than `-c`/`-d` at the Delve prompt.","commonSituations":"Habit from other CLIs (`quit!`, `exit 0`); typos like `exit -C` (case-sensitive flags); passing a shell-style argument after exit.","solutions":["Use bare `exit` to quit","Use `exit -c` to continue the program then exit","Use `exit -d` to detach without killing the process","Check spelling/case of the flag: only -c and -d are valid"],"exampleFix":"// before\nexit now\n// after\nexit -d","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"switch arg {\ncase \"\", \"-c\", \"-d\":\n    // proceed\ndefault:\n    return fmt.Errorf(\"unsupported exit arg %q\", arg)\n}","preventionTips":["Whitelist the three accepted forms in any scripting layer"],"tags":["terminal","cli","exit"],"backgroundTag":"invalid-command-option","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}