rusty-lines

Crates.iorusty-lines
lib.rsrusty-lines
version0.3.1
sourcesrc
created_at2024-04-18 10:27:16.167155
updated_at2024-11-18 12:09:01.638968
descriptionAbstract reading lines from tty or File
homepage
repositoryhttps://github.com/paulusminus/transipctl
max_upload_size
id1212385
size25,226
Paul Min (paulusminus)

documentation

README

build-badge License: MIT docs.rs Crates.io

rusty-lines

Rusty-lines is a library that abstracts the way lines are read from a tty or from a file. When using the file lines reader you can optionally replace environment variables names with their values.

It uses rustyline for reading from tty.

Example using tty

use rusty_lines::TTYLinesBuilder;

let lines = TTYLinesBuilder::prompt("tip")
    .exit_on(&["exit"])
    .history("history.txt")
    .build()
    .unwrap();

Example using file

use rusty_lines::FileLinesBuilder;

let lines = FileLinesBuilder::file("Cargo.toml")
    .build()
    .unwrap();
Commit count: 282

cargo fmt