Skip to main content

with_stdin_support

Function with_stdin_support 

Source
pub fn with_stdin_support<F>(file: &Path, f: F) -> Result<(), CliError>
where F: FnOnce(&Path) -> Result<(), CliError>,
Expand description

Run a command with stdin pipe support and directory resolution.

  • If file is -, buffer stdin to a tempfile.
  • If file is a directory, resolve to the model file inside it (e.g., model.safetensors, *.gguf, *.apr).
  • Otherwise pass the path through.