diff --git a/Cargo.lock b/Cargo.lock index f18a32f..6728cec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -218,7 +218,6 @@ version = "0.8.6" dependencies = [ "ansi_term", "assert_cmd", - "atty", "clap", "clap_complete", "clap_mangen", diff --git a/Cargo.toml b/Cargo.toml index b96ecf7..14b4611 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,6 @@ strip = true [dependencies] ansi_term = "0.12" -atty = "0.2.14" clap = "3.2.17" lscolors = "0.13" terminal_size = "0.2" diff --git a/src/main.rs b/src/main.rs index fb1420b..998fd31 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,7 +17,6 @@ use filter::AggregateData; use progress::PIndicator; use progress::ORDERING; use std::collections::HashSet; -use std::io::BufRead; use std::panic; use std::process; use sysinfo::{System, SystemExt}; @@ -99,27 +98,13 @@ fn get_regex_value(maybe_value: Option) -> Vec { .collect() } -// Returns a list of lines from stdin or `None` if there's nothing to read -fn get_lines_from_stdin() -> Option> { - atty::isnt(atty::Stream::Stdin).then(|| { - std::io::stdin() - .lock() - .lines() - .collect::>() - .expect("Error reading from stdin") - }) -} - fn main() { let options = build_cli().get_matches(); let config = get_config(); - let stdin_lines = get_lines_from_stdin(); let target_dirs = match options.values_of("inputs") { Some(values) => values.collect(), - None => stdin_lines.as_ref().map_or(vec!["."], |lines| { - lines.iter().map(String::as_str).collect() - }), + None => vec!["."], }; let summarize_file_types = options.is_present("types");