Repository: nushell/nushell
File: crates/nu-command/src/strings/format/filesize.rs (Rust)

Code before:
                (Type::record(), Type::record()),
            ])
            .allow_variants_without_examples(true)
            .required(
                "format value",
                SyntaxShape::String,
                "The format into which convert the file sizes.",
            )
            .rest(
                "rest",
                SyntaxShape::CellPath,
                "For a data structure input, format filesizes at the given cell paths.",
            )
            .category(Category::Strings)
    }

    fn description(&self) -> &str {
        "Converts a column of filesizes to some specified format."
    }

    fn extra_description(&self) -> &str {
        "Decimal precision is controlled by `$env.config.float_precision`."
    }

    fn search_terms(&self) -> Vec<&str> {
        vec!["convert", "display", "pattern", "human readable"]
    }

    fn run(
        &self,
        engine_state: &EngineState,
        stack: &mut Stack,
        call: &Call,
        input: PipelineData,
    ) -> Result<PipelineData, ShellError> {
        let unit = parse_filesize_unit(call.req::<Spanned<String>>(engine_state, stack, 0)?)?;
        let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?;
        let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
        // Read runtime config so `$env.config.float_precision` changes are honored.
        let float_precision = stack
            .get_config(engine_state)
            .float_precision
            .max(0) as usize;
        let arg = Arguments {
            unit,
            float_precision,
            cell_paths,
        };
        operate(
            format_value_impl,
            arg,

Review comment (suggestion):
I'm not sure those last two fit.
```suggestion
        vec!["convert", "display"]
```

Code after:
                (Type::record(), Type::record()),
            ])
            .allow_variants_without_examples(true)
            .required(
                "format value",
                SyntaxShape::String,
                "The format into which convert the file sizes.",
            )
            .rest(
                "rest",
                SyntaxShape::CellPath,
                "For a data structure input, format filesizes at the given cell paths.",
            )
            .category(Category::Strings)
    }

    fn description(&self) -> &str {
        "Converts a column of filesizes to some specified format."
    }

    fn extra_description(&self) -> &str {
        "Decimal precision is controlled by `$env.config.float_precision`."
    }

    fn search_terms(&self) -> Vec<&str> {
        vec!["convert", "display"]
    }

    fn is_const(&self) -> bool {
        true
    }

    fn run(
        &self,
        engine_state: &EngineState,
        stack: &mut Stack,
        call: &Call,
        input: PipelineData,
    ) -> Result<PipelineData, ShellError> {
        let unit = parse_filesize_unit(call.req::<Spanned<String>>(engine_state, stack, 0)?)?;
        let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 1)?;
        let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
        // Read runtime config so `$env.config.float_precision` changes are honored.
        let float_precision = stack.get_config(engine_state).float_precision.max(0) as usize;
        let arg = Arguments {
            unit,
            float_precision,
            cell_paths,
        };
        operate(
            format_value_impl,