tmux-copyrat/src/main.rs

18 lines
369 B
Rust
Raw Normal View History

2020-05-24 21:02:11 +02:00
use clap::Clap;
use std::io::{self, Read};
2020-06-02 20:03:16 +02:00
2020-05-25 23:06:00 +02:00
use copyrat::{run, Opt};
2020-06-02 20:03:16 +02:00
fn main() {
2020-05-24 21:02:11 +02:00
let opt = Opt::parse();
// Copy the pane contents (piped in via stdin) into a buffer, and split lines.
let stdin = io::stdin();
let mut handle = stdin.lock();
let mut buffer = String::new();
handle.read_to_string(&mut buffer).unwrap();
2020-05-25 23:06:00 +02:00
run(buffer, opt);
2020-06-02 20:03:16 +02:00
}