{"record":{"id":"7891ba12871d385b","repo":"denoland/deno","slug":"the-argument-previous-cannot-be-used-with-na","errorCode":null,"errorMessage":"the argument '{previous}' cannot be used with '{name}'","messagePattern":"the argument '(.+?)' cannot be used with '(.+?)'","errorType":"validation","errorClass":"AnyError","httpStatus":null,"severity":"error","filePath":"libs/dcore/src/main.rs","lineNumber":196,"sourceCode":"      None => Ok(None),\n      Some(v) => v.parse::<SocketAddr>().map(Some).map_err(|e| {\n        anyhow::anyhow!(\"invalid value '{v}' for '{flag}=<HOST_AND_PORT>': {e}\")\n      }),\n    };\n\n    for arg in args {\n      let (name, value) = match arg.split_once('=') {\n        Some((name, value)) => (name, Some(value)),\n        None => (arg.as_str(), None),\n      };\n      match name {\n        \"-h\" | \"--help\" => {\n          println!(\"{USAGE}\");\n          return Ok(None);\n        }\n        \"--inspect\" | \"--inspect-brk\" | \"--inspect-wait\" => {\n          if let Some(previous) = seen_inspect_flag {\n            bail!(\"the argument '{previous}' cannot be used with '{name}'\");\n          }\n          seen_inspect_flag = Some(match name {\n            \"--inspect\" => \"--inspect\",\n            \"--inspect-brk\" => \"--inspect-brk\",\n            _ => \"--inspect-wait\",\n          });\n          let addr = parse_addr(name, value)?;\n          match name {\n            \"--inspect\" => out.inspect = Some(addr),\n            \"--inspect-wait\" => out.inspect_wait = Some(addr),\n            // `--inspect-brk` is accepted but not wired up to the inspector\n            // server, matching the previous clap-based behavior.\n            _ => {}\n          }\n        }\n        \"--strace-ops\" => out.strace_ops = true,\n        \"--strace-ops-summary\" => out.strace_ops_summary = true,\n        \"--v8-flags\" => {","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/libs/dcore/src/main.rs#L178-L214","documentation":"The `dcore` runtime binary (Deno's minimal core runner) accepts `--inspect`, `--inspect-brk` and `--inspect-wait`, but only one per invocation. The parser records the first seen in `seen_inspect_flag`; any subsequent `--inspect*` flag bails naming both the previous and the new flag. Each flag also accepts an optional `=host:port` value.","triggerScenarios":"Invoking dcore with two inspector flags in one command: `dcore --inspect --inspect-wait app.js`, `dcore --inspect-brk --inspect=127.0.0.1:9230 app.js`, or any other pairing of the three.","commonSituations":"Editor/IDE debug launch configs that append `--inspect` to a template that already contains `--inspect-brk`; copy-pasted commands combining 'break at start' and 'wait for debugger' variants.","solutions":["Keep exactly one inspector flag — prefer `--inspect-wait` for debugging (waits for the debugger before running user code) or plain `--inspect`.","Edit the launch config/alias so the flags are not stacked.","Run `dcore -h` to confirm the supported flag set."],"exampleFix":"# before\ndcore --inspect --inspect-brk app.js\n# error: the argument '--inspect' cannot be used with '--inspect-brk'\n\n# after: exactly one inspector flag\ndcore --inspect-wait app.js","handlingStrategy":"validation","validationCode":"# reject stacked --inspect* flags before invoking dcore\nn=0\nfor a in \"$@\"; do\n  case \"$a\" in --inspect|--inspect-brk|--inspect-wait|--inspect=*|--inspect-brk=*|--inspect-wait=*) n=$((n+1));; esac\ndone\n[ \"$n\" -gt 1 ] && { echo \"only one --inspect* flag is allowed\"; exit 2; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Standardize launch configs on a single inspector flag (--inspect-wait for debugging).","Lint debug snippets/templates that append inspector flags to existing commands.","Remember --inspect-brk is accepted but not wired to the inspector server in dcore — prefer --inspect-wait."],"tags":["cli","arguments","inspector","debugging","dcore"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}