diff --git a/Cargo.lock b/Cargo.lock index d5877f7..060b31a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,12 +52,6 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -140,7 +134,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "dirs-sys-next", ] @@ -177,7 +171,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8806dd91a06a7a403a8e596f9bfbfb34e469efbc363fc9c9713e79e26472e36" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "winapi", ] @@ -194,7 +188,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi", ] @@ -223,18 +217,6 @@ dependencies = [ "unindent", ] -[[package]] -name = "isatty" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e31a8281fc93ec9693494da65fbf28c0c2aa60a2eaec25dc58e2f31952e95edc" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "redox_syscall 0.1.57", - "winapi", -] - [[package]] name = "jless" version = "0.9.0" @@ -242,7 +224,6 @@ dependencies = [ "clap", "clipboard", "indoc", - "isatty", "lazy_static", "libc", "libc-stdhandle", @@ -290,7 +271,7 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -358,7 +339,7 @@ checksum = "e7555d6c7164cc913be1ce7f95cbecdabda61eb2ccd89008524af306fb7f5031" dependencies = [ "bitflags", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "memoffset", ] @@ -462,12 +443,6 @@ dependencies = [ "nibble_vec", ] -[[package]] -name = "redox_syscall" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" - [[package]] name = "redox_syscall" version = "0.2.6" @@ -483,7 +458,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8440d8acb4fd3d277125b4bd01a6f38aee8d814b3b5fc09b3f2b825d37d3fe8f" dependencies = [ - "redox_syscall 0.2.6", + "redox_syscall", ] [[package]] @@ -493,7 +468,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" dependencies = [ "getrandom", - "redox_syscall 0.2.6", + "redox_syscall", ] [[package]] @@ -520,7 +495,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "790487c3881a63489ae77126f57048b42d62d3b2bafbf37453ea19eedb6340d6" dependencies = [ "bitflags", - "cfg-if 1.0.0", + "cfg-if", "clipboard-win 4.2.1", "dirs-next", "fd-lock", @@ -608,7 +583,7 @@ checksum = "077185e2eac69c3f8379a4298e1e07cd36beb962290d4a51199acf0fdc10607e" dependencies = [ "libc", "numtoa", - "redox_syscall 0.2.6", + "redox_syscall", "redox_termios", ] diff --git a/Cargo.toml b/Cargo.toml index 5b90093..df75eaf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,6 @@ termion = "1.5.6" signal-hook = "0.3.8" libc = "0.2" clap = { version = "4.0", features = ["derive"] } -isatty = "0.1" libc-stdhandle = "0.1.0" yaml-rust = "0.4" clipboard = "0.5" diff --git a/src/main.rs b/src/main.rs index 33d942f..3afe418 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,6 +11,7 @@ use std::fs::File; use std::io; use std::io::Read; use std::path::PathBuf; +use std::io::IsTerminal; use clap::Parser; use termion::cursor::HideCursor; @@ -51,7 +52,7 @@ fn main() { let data_format = determine_data_format(opt.data_format(), &input_filename); - if !isatty::stdout_isatty() { + if !std::io::stdout().is_terminal() { print_pretty_printed_input(input_string, data_format); std::process::exit(0); } @@ -102,7 +103,7 @@ fn get_input_and_filename(opt: &Opt) -> io::Result<(String, String)> { match &opt.input { None => { - if isatty::stdin_isatty() { + if std::io::stdout().is_terminal() { println!("Missing filename (\"jless --help\" for help)"); std::process::exit(1); }