{"record":{"id":"f3a9a18a76b8d702","repo":"jdx/mise","slug":"title-requires-exactly-1-argument","errorCode":null,"errorMessage":"title requires exactly 1 argument","messagePattern":"title requires exactly 1 argument","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/aqua-registry/src/template.rs","lineNumber":351,"sourceCode":"        if args.len() != 1 {\n            bail!(\"semver requires exactly 1 argument\");\n        }\n        let input = args[0].as_string();\n        let clean_version = input.strip_prefix('v').unwrap_or(&input);\n        let version = Versioning::new(clean_version)\n            .wrap_err_with(|| format!(\"invalid semver version: {input}\"))?;\n\n        Ok(Box::new(SemVerValue {\n            major: version.nth(0).unwrap_or(0),\n            minor: version.nth(1).unwrap_or(0),\n            patch: version.nth(2).unwrap_or(0),\n            original: clean_version.to_string(),\n        }) as Box<dyn Value>)\n    });\n\n    registry.insert(\"title\", |args| {\n        if args.len() != 1 {\n            bail!(\"title requires exactly 1 argument\");\n        }\n        Ok(Box::new(StringValue(args[0].as_string().to_title_case())) as Box<dyn Value>)\n    });\n\n    registry.insert(\"trimV\", |args| {\n        if args.len() != 1 {\n            bail!(\"trimV requires exactly 1 argument\");\n        }\n        Ok(Box::new(StringValue(\n            args[0].as_string().trim_start_matches('v').to_string(),\n        )) as Box<dyn Value>)\n    });\n\n    registry.insert(\"trimPrefix\", |args| {\n        if args.len() != 2 {\n            bail!(\"trimPrefix requires exactly 2 arguments\");\n        }\n        let prefix = args[0].as_string();","sourceCodeStart":333,"sourceCodeEnd":369,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/crates/aqua-registry/src/template.rs#L333-L369","documentation":"Arity guard inside the template function registry in crates/aqua-registry/src/template.rs. It fires when a template invokes the `semver` filter with an argument count other than one (zero args or multiple pipe-segment args), before any version parsing happens. Note the message names `semver` — the error string is a shared/templated guard; the same bail text pattern is used across the registry's filters, so a mislabeled filter name in the message can occur when the guard is copied between registrations.","triggerScenarios":"Thrown at crates/aqua-registry/src/template.rs:351 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call title with exactly one argument, e.g. `(title .Name)`","Apply title only to a single string value"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}