mirror of
https://github.com/jht5945/finding.git
synced 2025-12-27 13:20:03 +08:00
add get_term_width
This commit is contained in:
@@ -6,4 +6,5 @@ edition = "2018"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
argparse = "0.2.2"
|
argparse = "0.2.2"
|
||||||
|
term_size = "0.3.1"
|
||||||
rust_util = { git = "https://github.com/jht5945/rust_util" }
|
rust_util = { git = "https://github.com/jht5945/rust_util" }
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
extern crate argparse;
|
extern crate argparse;
|
||||||
|
extern crate term_size;
|
||||||
extern crate rust_util;
|
extern crate rust_util;
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
@@ -53,6 +54,13 @@ fn find_huge_files(huge_file_size: &String, dir_path: &Path) {
|
|||||||
print_lastline("");
|
print_lastline("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn get_term_width() -> Option<usize> {
|
||||||
|
match term_size::dimensions() {
|
||||||
|
None => None,
|
||||||
|
Some((w, _h)) => Some(w),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut version = false;
|
let mut version = false;
|
||||||
let mut target = String::from("text");
|
let mut target = String::from("text");
|
||||||
|
|||||||
Reference in New Issue
Block a user