Skip to content

Commit

Permalink
Switch atty to is-terminal (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkforest committed Dec 27, 2022
1 parent 8abc3a3 commit e206f71
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Expand Up @@ -20,6 +20,7 @@ exclude = [
appveyor = { repository = "phsym/prettytable-rs", branch = "master", service = "github" }
travis-ci = { repository = "phsym/prettytable-rs", branch = "master" }
codecov = { repository = "phsym/prettytable-rs", branch = "master", service = "github" }
maintenance = { status = "passively-maintained" }

[features]
default = ["win_crlf", "csv"]
Expand All @@ -38,6 +39,6 @@ name = "prettytable"
unicode-width = "0.1"
term = "0.7"
lazy_static = "1"
atty = "0.2"
is-terminal = "0.4"
encode_unicode = "1"
csv = { version = "1", optional = true }
7 changes: 1 addition & 6 deletions README.md
Expand Up @@ -6,11 +6,6 @@
[![Doc.rs](https://docs.rs/prettytable-rs/badge.svg)](https://docs.rs/crate/prettytable-rs/)
[![Doc.rs](https://img.shields.io/badge/docs-master-blue.svg)](http://phsym.github.io/prettytable-rs/master)

> This crate has been abandonned without notice for quite a while due to some personnal reasons. My apologies for that.
I'll try to do my best to continue to maintain it, at least for security updates. If I can't the find time to do it, I'll have no other option than
deprecating it, or find new contributors to handover the maintenance to. Feel free to raise your hand if you're interrested.
In the meantime, please expect a low update rate, and again please accept my apologies.

# prettytable-rs

A formatted and aligned table printer library for [Rust](https://www.rust-lang.org).
Expand Down Expand Up @@ -45,7 +40,7 @@ Include the library as a dependency to your project by adding the following line
prettytable-rs = "^0.9"
```

The library requires at least `rust v1.32.0`.
The library requires at least `rust v1.41`.

## Basic usage

Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Expand Up @@ -193,7 +193,8 @@ impl<'a> TableSlice<'a> {
/// # Returns
/// A `Result` holding the number of lines printed, or an `io::Error` if any failure happens
pub fn print_tty(&self, force_colorize: bool) -> Result<usize, Error> {
match (stdout(), atty::is(atty::Stream::Stdout) || force_colorize) {
use is_terminal::IsTerminal;
match (stdout(), io::stdout().is_terminal() || force_colorize) {
(Some(mut o), true) => self.print_term(&mut *o),
_ => self.print(&mut io::stdout()),
}
Expand Down

0 comments on commit e206f71

Please sign in to comment.