Skip to content

Commit a0d7e01

Browse files
committed
fixed issue with hanging on non std (file) input
1 parent ebe8ff3 commit a0d7e01

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
workspace = { members = [ "tests","tests/obfuscate_access_log_ips"] }
22
[package]
33
name = "ngxav"
4-
version = "0.6.1"
4+
version = "0.6.2"
55
edition = "2021"
66
license = "MIT"
77
description = "Search through NGINX logs with advanced filters and support for displaying analytics about your selected log entries"

src/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ use atty::Stream;
33
use clap::Parser;
44
use rayon::prelude::*;
55
use std::collections::HashMap;
6-
use std::iter::FromIterator;
6+
use std::io::IsTerminal;
7+
78
use utils::keep_line::keep_line;
89
use utils::parse_nginx_time_format::parse_nginx_time_format;
910
use utils::read_folder::read_folder;
@@ -32,6 +33,10 @@ fn read_line_by_line(filename: impl AsRef<Path>) -> io::Result<io::Lines<io::Buf
3233

3334
fn load_stdin() -> Vec<String> {
3435
let stdin = io::stdin();
36+
if std::io::stdin().is_terminal() {
37+
return Vec::new();
38+
}
39+
3540
return stdin
3641
.lock()
3742
.lines()

0 commit comments

Comments
 (0)