jdx/mise · error

trimV requires exactly 1 argument

Error message

trimV requires exactly 1 argument

What it means

Arity guard for the `title` template filter in the aqua-registry template function registry. The filter converts its single string argument to title case (via to_title_case) for package names/labels in aqua templates. It fires when a template calls `title` without exactly one argument — typically a template authored with `title` applied to a multi-value expression or a missing piped value.

Solutions

  1. Call trimV with exactly one argument, e.g. `(trimV .Version)`
  2. Use replace if you need to strip a different prefix
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/aqua-registry/src/template.rs:358 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/6eb9cd89e49a859c. Report an issue: GitHub.

Appendix: source

Thrown at crates/aqua-registry/src/template.rs:358

        Ok(Box::new(SemVerValue {
            major: version.nth(0).unwrap_or(0),
            minor: version.nth(1).unwrap_or(0),
            patch: version.nth(2).unwrap_or(0),
            original: clean_version.to_string(),
        }) as Box<dyn Value>)
    });

    registry.insert("title", |args| {
        if args.len() != 1 {
            bail!("title requires exactly 1 argument");
        }
        Ok(Box::new(StringValue(args[0].as_string().to_title_case())) as Box<dyn Value>)
    });

    registry.insert("trimV", |args| {
        if args.len() != 1 {
            bail!("trimV requires exactly 1 argument");
        }
        Ok(Box::new(StringValue(
            args[0].as_string().trim_start_matches('v').to_string(),
        )) as Box<dyn Value>)
    });

    registry.insert("trimPrefix", |args| {
        if args.len() != 2 {
            bail!("trimPrefix requires exactly 2 arguments");
        }
        let prefix = args[0].as_string();
        let text = args[1].as_string();
        Ok(Box::new(StringValue(
            text.strip_prefix(&prefix).unwrap_or(&text).to_string(),
        )) as Box<dyn Value>)
    });

    registry.insert("trimSuffix", |args| {

View on GitHub (pinned to 533346cc37)