Skip to content

Commit

Permalink
Replace unmaintained atty crate with standard library implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
dns13 committed Mar 5, 2024
1 parent bb89eee commit e70fbe1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## 1.1.3 (unreleased)
- Update rustyline to v13.0
- Replace unmaintained atty crate with standard library implementation

## 1.1.2 (05.03.2024)
- Add history element even if parsing fails
Expand Down
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ path = "src/main.rs"
[dependencies]
json = "0.12.4"
structopt = "0.3"
atty = "0.2"
rmpv = { version = "1.0", features = ["with-serde"] }
rmp-serde = "1.1"
serde_json = "1.0"
Expand Down
7 changes: 3 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use atty::Stream;
use bone_api::Bone;
use network_interface::{NetworkInterface, NetworkInterfaceConfig};
use std::io::*;
Expand Down Expand Up @@ -132,10 +131,10 @@ fn main() -> std::io::Result<()> {
&mut bone1,
&command,
!opt.no_pretty,
atty::is(Stream::Stdout) && opt.response_time,
std::io::stdout().is_terminal() && opt.response_time,
false,
);
} else if !atty::is(Stream::Stdin) {
} else if !std::io::stdin().is_terminal() {
// pipe mode
let mut command = String::new();
stdin().read_line(&mut command).unwrap();
Expand All @@ -145,7 +144,7 @@ fn main() -> std::io::Result<()> {
&mut bone1,
&command,
!opt.no_pretty,
atty::is(Stream::Stdout) && opt.response_time,
std::io::stdout().is_terminal() && opt.response_time,
false,
);
} else {
Expand Down

0 comments on commit e70fbe1

Please sign in to comment.