{"record":{"id":"6282d2e39fbae11a","repo":"denoland/deno","slug":"unexpected-argument-name-found","errorCode":null,"errorMessage":"unexpected argument '{name}' found","messagePattern":"unexpected argument '(.+?)' found","errorType":"validation","errorClass":"AnyError","httpStatus":null,"severity":"error","filePath":"libs/dcore/src/main.rs","lineNumber":221,"sourceCode":"          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\" => {\n          let Some(value) = value else {\n            bail!(\"equal sign is needed when assigning values to '--v8-flags'\");\n          };\n          out.v8_flags.extend(value.split(',').map(String::from));\n        }\n        _ if name.starts_with('-') && name != \"-\" => {\n          bail!(\"unexpected argument '{name}' found\");\n        }\n        _ => {\n          if file_path.is_some() {\n            bail!(\"unexpected argument '{arg}' found\");\n          }\n          file_path = Some(arg);\n        }\n      }\n    }\n\n    let Some(file_path) = file_path else {\n      bail!(\n        \"the following required arguments were not provided:\\n  <file_path>\"\n      );\n    };\n    out.file_path = file_path;\n    Ok(Some(out))\n  }","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/libs/dcore/src/main.rs#L203-L239","documentation":"`dcore`'s hand-rolled parser recognizes only `-h`/`--help`, the three `--inspect*` flags, `--strace-ops`, `--strace-ops-summary`, and `--v8-flags=<value>`. Any other token beginning with `-` (except the bare `-` marker) falls to the catch-all arm and bails as an unexpected argument.","triggerScenarios":"Passing full-Deno CLI flags to dcore: `dcore --allow-read app.js`, `--quiet`, `--reload`, `--watch`; or a typo like `--strace-op` (missing the s). Flags dcore does implement always parse via their exact names.","commonSituations":"Muscle memory from `deno run` flags (permissions, watch, reload); scripts or aliases originally written for the deno binary; docs copied between the two CLIs.","solutions":["Remove flags dcore does not support — list them with `dcore -h`.","Use the full `deno` binary when you need permission/watch/reload flags; dcore is the minimal core runner with only inspect/strace/v8 flags.","Fix typos in supported flags (e.g. `--strace-ops`, not `--strace-op`)."],"exampleFix":"# before\ndcore --allow-read --quiet app.js\n# error: unexpected argument '--allow-read' found\n\n# after: dcore has no permission system or quiet flag\ndcore app.ts\n# need those flags? use deno:\ndeno run --allow-read --quiet app.ts","handlingStrategy":"validation","validationCode":"# flag allowlist check for dcore invocations\nfor a in \"$@\"; do\n  case \"$a\" in\n    -h|--help|--inspect|--inspect-brk|--inspect-wait|--strace-ops|--strace-ops-summary|-) ;;\n    --inspect=*|--inspect-brk=*|--inspect-wait=*|--v8-flags=*) ;;\n    -*) echo \"dcore does not support: $a\" ;;\n  esac\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check `dcore -h` when porting deno command lines — dcore has no permission/watch/reload flags.","Keep separate aliases for deno and dcore invocations instead of editing flags ad hoc.","In wrappers, validate args against the allowlist before forwarding."],"tags":["cli","arguments","dcore","flags"],"backgroundTag":"unknown-cli-flag","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"}