Skip to main content

Module stdin

Module stdin 

Source
Expand description

Utilities for reading from stdin in pipe-friendly commands.

Supports the - convention: --description - reads from stdin. Also supports reading bean IDs from stdin, one per line.

Functions§

read_ids_from_stdin
Read bean IDs from stdin, one per line. Trims whitespace and skips empty lines.
read_stdin
Read all of stdin into a string. Returns an error if stdin is a terminal (not piped).
resolve_stdin_opt
Resolve an Option<String> that might contain “-”.
resolve_stdin_value
Resolve a value that might be “-” (meaning read from stdin). If the value is “-”, reads stdin. Otherwise returns the value as-is.