diff --git a/Cargo.toml b/Cargo.toml index 5b7bb3d..f4d2479 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,4 +6,5 @@ edition = "2018" [dependencies] argparse = "0.2.2" +term_size = "0.3.1" rust_util = { git = "https://github.com/jht5945/rust_util" } diff --git a/src/main.rs b/src/main.rs index 78e1111..eba2fe1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ extern crate argparse; +extern crate term_size; extern crate rust_util; use std::{ @@ -53,6 +54,13 @@ fn find_huge_files(huge_file_size: &String, dir_path: &Path) { print_lastline(""); } +fn get_term_width() -> Option { + match term_size::dimensions() { + None => None, + Some((w, _h)) => Some(w), + } +} + fn main() { let mut version = false; let mut target = String::from("text");