Skip to content

Commit 5e9318c

Browse files
authored
Remove usage of atty crate (#480)
1 parent 44265de commit 5e9318c

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ edition = "2018"
1313
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1414

1515
[dependencies]
16-
atty = "0.2"
1716
clap = { version = "3.2.16", features = ["derive"] }
1817
ctrlc = { version = "3.2", features = ["termination"] }
1918
dirs = "3.0.2"

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use regex::Regex;
66
use similar::TextDiff;
77
use std::ffi::OsStr;
88
use std::fs::{read_to_string, File, OpenOptions};
9-
use std::io::{self, BufRead, BufReader, Read, Write};
9+
use std::io::{self, BufRead, BufReader, IsTerminal, Read, Write};
1010
use std::path::Path;
1111
use std::process::{exit, Command};
1212
use std::sync::{Arc, Mutex};
@@ -276,7 +276,7 @@ fn iterate_input_files(opts: &CommandlineOpts, f: &dyn Fn((&Path, &String))) {
276276
// If not include paths are present, assume user is passing via STDIN
277277
let mut buffer = String::new();
278278

279-
if atty::is(atty::Stream::Stdin) {
279+
if io::stdin().is_terminal() {
280280
// Call executable with `--help` args to print help statement
281281
let mut command = Command::new(std::env::current_exe().unwrap());
282282
command.arg("--help");

0 commit comments

Comments
 (0)