{"record":{"id":"0e597a0394563024","repo":"jdx/mise","slug":"platform-bin-spec-must-be-in-format-platform-path","errorCode":null,"errorMessage":"Platform bin spec must be in format 'platform:path', got: {}","messagePattern":"Platform bin spec must be in format 'platform:path', got: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/generate/tool_stub.rs","lineNumber":553,"sourceCode":"            // Format: platform:url\n            let parts: Vec<&str> = spec.splitn(2, ':').collect();\n            if parts.len() != 2 {\n                bail!(\n                    \"Platform spec must be in format 'platform:url' or just 'url' (for auto-detection). Got: {}\",\n                    spec\n                );\n            }\n\n            let platform = parts[0].to_string();\n            let url = parts[1].to_string();\n            Ok((platform, url))\n        }\n    }\n\n    fn parse_platform_bin_spec(&self, spec: &str) -> Result<(String, String)> {\n        let parts: Vec<&str> = spec.splitn(2, ':').collect();\n        if parts.len() != 2 {\n            bail!(\n                \"Platform bin spec must be in format 'platform:path', got: {}\",\n                spec\n            );\n        }\n\n        let platform = parts[0].to_string();\n        let bin_path = parts[1].to_string();\n\n        Ok((platform, bin_path))\n    }\n\n    async fn analyze_url(\n        &self,\n        url: &str,\n        mpr: &std::sync::Arc<crate::ui::multi_progress_report::MultiProgressReport>,\n    ) -> Result<(String, u64, Option<String>)> {\n        // Create a temporary directory for download and extraction\n        let temp_dir = tempfile::tempdir()?;","sourceCodeStart":535,"sourceCodeEnd":571,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/generate/tool_stub.rs#L535-L571","documentation":"This error is thrown by `parse_platform_bin_spec` when a `--platform-bin` argument does not contain a ':'-separated 'platform:path' pair. The spec is split once on ':' and must yield exactly two parts: the platform name and the path to the binary inside the archive. It validates user-provided binary location overrides before archive analysis.","triggerScenarios":"Running `mise generate tool-stub` with `--platform-bin` set to a value without a colon, e.g. --platform-bin bin/tool (missing the platform prefix) or --platform-bin linux (path omitted).","commonSituations":"Users copying the --bin flag syntax (which takes only a path) instead of --platform-bin; Windows-style absolute paths like C:\\bin\\tool confusing the author about separator placement; forgetting the platform prefix when specifying per-platform binaries.","solutions":["Change the value to include the platform prefix: --platform-bin linux:bin/tool","Check that you are using --platform-bin (requires platform:path) and not --bin (path only)","Quote the argument so platform and path remain one shell word: --platform-bin \"macos-x64:bin/tool\""],"exampleFix":"// before\n--platform-bin bin/tool\n// after\n--platform-bin linux:bin/tool","handlingStrategy":"validation","validationCode":"validate_platform_bin() {\n  local spec=\"$1\"\n  case \"$spec\" in\n    *:*) return 0 ;;\n    *) echo \"--platform-bin must be 'platform:path'\" >&2; return 1 ;;\n  esac\n}\nvalidate_platform_bin \"$SPEC\" || exit 1","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember --platform-bin needs the platform prefix; use --bin for a path-only override","Quote arguments containing colons","Verify archive-relative binary paths with tar -tf before generating the stub"],"tags":["cli","argument-parsing","platform-spec"],"backgroundTag":"invalid-argument-format","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}