skip/src/main.rs

16 lines
309 B
Rust
Raw Normal View History

2023-03-20 07:24:42 +00:00
use clap::Parser;
2023-03-22 07:35:35 +00:00
use skip::{skip, Cli, Result};
2023-03-20 21:33:10 +00:00
use std::io::Write;
2023-03-20 07:24:42 +00:00
2023-03-22 07:35:35 +00:00
fn main() -> Result<()> {
2023-03-21 20:43:10 +00:00
let cli = Cli::parse();
2023-03-21 07:23:20 +00:00
2023-03-20 21:33:10 +00:00
let stdout = std::io::stdout();
2023-03-21 07:23:20 +00:00
let mut output = stdout.lock();
2023-03-22 06:52:40 +00:00
skip(&cli, |line| match writeln!(output, "{}", line) {
Err(_) => (),
Ok(_) => (),
2023-03-21 07:23:20 +00:00
})
2023-03-19 18:02:45 +00:00
}