{"record":{"id":"4766ae7eb368b96d","repo":"jdx/mise","slug":"cannot-combine-flag-with-an-inline-key-option","errorCode":null,"errorMessage":"cannot combine {flag} with an inline {key} option for {}","messagePattern":"cannot combine (.+?) with an inline (.+?) option for (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/use.rs","lineNumber":222,"sourceCode":"                .and_then(|mut table| table.remove(\"value\"))\n                .unwrap_or_else(|| toml::Value::String(value.to_string()));\n            entries.push((key.to_string(), value, \"--tool-option\"));\n        }\n        let mut seen = std::collections::HashSet::new();\n        for (key, value, flag) in entries {\n            if !seen.insert(key.clone()) {\n                bail!(\n                    \"tool option {key:?} was specified more than once for {}\",\n                    self.tool\n                );\n            }\n            if self\n                .tool\n                .ba\n                .explicit_opts()\n                .is_some_and(|options| options.contains_key(&key))\n            {\n                bail!(\n                    \"cannot combine {flag} with an inline {key} option for {}\",\n                    self.tool\n                );\n            }\n            options\n                .insert_option(key, value)\n                .map_err(|error| eyre!(error))?;\n        }\n        Ok(options)\n    }\n}\n\nimpl Use {\n    pub(super) fn is_dry_run(&self) -> bool {\n        self.dry_run || self.dry_run_code\n    }\n\n    pub(crate) async fn run(mut self) -> Result<()> {","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/use.rs#L204-L240","documentation":"The tool was invoked with inline options embedded in the tool string (e.g. `node[a=b]`) and additionally the same key was passed via a flag (--tool-option/--env, tracked by `flag`). request_options() refuses the ambiguous combination when the key already exists in the tool's explicit_opts().","triggerScenarios":"`mise use 'node[opt=x]' --tool-option opt=y` — the key `opt` present in ba.explicit_opts() collides with the flag-provided key in request_options().","commonSituations":"Mixing bracketed inline tool options with --tool-option flags; extending an existing command line by appending a flag without noticing the inline options.","solutions":["Remove the inline option from the tool string and keep the flag.","Or remove the redundant --tool-option flag and rely on the inline option."],"exampleFix":"// before\nmise use 'node[cache=true]' --tool-option cache=false\n// after\nmise use node --tool-option cache=false","handlingStrategy":"validation","validationCode":"[[ \"$tool\" == *'['*']' ]] && echo 'inline options present; do not pass --tool-option for the same keys'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pick one style: inline bracket options OR --tool-option flags, not both for the same key.","When wrapping mise use, detect bracketed tool syntax and skip flag options.","Standardize the team's option mechanism in docs."],"tags":["cli","tool-options","conflicting-options"],"backgroundTag":"mutually-exclusive-options","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}