onelineout

Crates.ioonelineout
lib.rsonelineout
version0.1.0
created_at2025-11-13 19:26:35.971493+00
updated_at2025-11-13 19:26:35.971493+00
descriptionPrint piped input lines and update the terminal line using carriage return (\r).
homepagehttps://github.com/fepfitra/onelineout
repositoryhttps://github.com/fepfitra/onelineout
max_upload_size
id1931764
size3,552
Fitriansyah Eka Putra (fepfitra)

documentation

https://docs.rs/onelineout

README

onelineout

Small Rust utility that reads lines from stdin and prints each line followed by a carriage return (\r), allowing the output to overwrite the current terminal line.

Behavior

  • If a line contains only whitespace (or is empty), the program prints it normally with a newline.
  • Otherwise the program prints the line followed by \r and clears any leftover characters from the previous longer line.

Examples (POSIX shell)

# Print two lines where the second is shorter; the program clears leftover characters
printf "aaaaaaaaaa\nbbbb\n" | onelineout

# Pipe output from another program
ls -lah | onelineout

Notes

  • This is a tiny CLI intended to be used in pipelines. It is implemented in src/main.rs.
  • The program flushes stdout after each non-blank line to make live updating behavior visible in the terminal.
Commit count: 0

cargo fmt