Crates.io | rusty-lines |
lib.rs | rusty-lines |
version | 0.3.0 |
source | src |
created_at | 2024-04-18 10:27:16.167155 |
updated_at | 2024-04-19 06:29:24.402935 |
description | Abstract reading lines from tty or File |
homepage | |
repository | https://github.com/paulusminus/transipctl |
max_upload_size | |
id | 1212385 |
size | 25,389 |
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.
use rusty_lines::TTYLinesBuilder;
fn main() {
let lines = TTYLinesBuilder::prompt("tip")
.exit_on(&["exit"])
.history("history.txt")
.build()
.unwrap();
}
use rusty_lines::FileLinesBuilder;
fn main() {
let lines = FileLinesBuilder::file("Cargo.toml")
.build()
.unwrap();
}