{"record":{"id":"f4db97fa509ee8f4","repo":"jdx/mise","slug":"brew-cask-command-wrapper-has-unsupported-option-f4db97","errorCode":null,"errorMessage":"brew-cask: command_wrapper has unsupported option {}","messagePattern":"brew-cask: command_wrapper has unsupported option (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask/artifacts.rs","lineNumber":204,"sourceCode":"        .ok_or_else(|| eyre!(\"brew-cask: command_wrapper requires a command name\"))?;\n    let name_path = Path::new(name);\n    if name_path.file_name().and_then(|name| name.to_str()) != Some(name)\n        || matches!(name, \".\" | \"..\")\n    {\n        bail!(\"brew-cask: command_wrapper requires a command name without path components\");\n    }\n    let options = values\n        .get(1)\n        .and_then(Value::as_object)\n        .ok_or_else(|| eyre!(\"brew-cask: command_wrapper requires options\"))?;\n    let mut unsupported = options\n        .keys()\n        .filter(|key| !matches!(key.as_str(), \"content\" | \"executable\" | \"args\" | \"env\"))\n        .cloned()\n        .collect::<Vec<_>>();\n    unsupported.sort();\n    if !unsupported.is_empty() {\n        bail!(\n            \"brew-cask: command_wrapper has unsupported option {}\",\n            unsupported.join(\", \")\n        );\n    }\n    let content = options\n        .get(\"content\")\n        .and_then(Value::as_str)\n        .map(str::to_string);\n    let executable = options\n        .get(\"executable\")\n        .and_then(Value::as_str)\n        .map(str::to_string);\n    match (content.is_some(), executable.is_some()) {\n        (false, false) => {\n            bail!(\"brew-cask: command_wrapper requires content or executable\")\n        }\n        (true, true) => {\n            bail!(\"brew-cask: command_wrapper requires content or executable, not both\")","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/brew/cask/artifacts.rs#L186-L222","documentation":"Thrown when a cask command_wrapper artifact supplies option keys outside the supported set {content, executable, args, env}. The parser collects the unrecognized keys and bails with the joined list so the cask definition can be corrected.","triggerScenarios":"A command_wrapper options object contains any key other than 'content', 'executable', 'args', or 'env', e.g. a typo like 'arguments', 'contents', or 'name'.","commonSituations":"Typos in option names; carrying over options from a different artifact type; newer/older Homebrew stanza syntax not supported by this parser version.","solutions":["Remove or rename the listed unsupported options to one of content, executable, args, env.","Check spelling: 'args' not 'arguments', 'content' not 'contents'.","Confirm the cask syntax matches the version this parser supports; open the cask definition and prune unknown keys."],"exampleFix":"// before\n[\"mytool\", {\"executable\": \"mytool\", \"arguments\": [\"--help\"]}]\n// after\n[\"mytool\", {\"executable\": \"mytool\", \"args\": [\"--help\"]}]","handlingStrategy":"validation","validationCode":"const CW_KEYS: [&str; 4] = [\"content\", \"executable\", \"args\", \"env\"];\nfn cw_keys_ok(keys: &[&str]) -> Vec<&str> {\n    keys.iter().filter(|k| !CW_KEYS.contains(k)).cloned().collect()\n}\nassert!(cw_keys_ok(&[\"executable\"]).is_empty());","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"unsupported option\") => {\n        // parse the listed keys from the message and fix the cask definition\n    }\n    other => other?,\n}","preventionTips":["Keep a whitelist constant of allowed command_wrapper keys in your config generator","Spell-check option names against docs: content, executable, args, env","Validate cask JSON with a schema before parsing"],"tags":["brew-cask","validation","unsupported-option","config"],"backgroundTag":"unsupported-config-value","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}