diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 23 |
1 files changed, 9 insertions, 14 deletions
@@ -1,13 +1,13 @@ termcolor ========= A simple cross platform library for writing colored text to a terminal. This -library writes colored text either using standard ANSI escape sequences or -by interacting with the Windows console. Several convenient abstractions -are provided for use in single-threaded or multi-threaded command line +library writes colored text either using standard ANSI escape sequences or by +interacting with the Windows console. Several convenient abstractions are +provided for use in single-threaded or multi-threaded command line applications. [![Build status](https://github.com/BurntSushi/termcolor/workflows/ci/badge.svg)](https://github.com/BurntSushi/termcolor/actions) -[![](https://img.shields.io/crates/v/termcolor.svg)](https://crates.io/crates/termcolor) +[![crates.io](https://img.shields.io/crates/v/termcolor.svg)](https://crates.io/crates/termcolor) Dual-licensed under MIT or the [UNLICENSE](https://unlicense.org/). @@ -17,12 +17,7 @@ Dual-licensed under MIT or the [UNLICENSE](https://unlicense.org/). ### Usage -Add this to your `Cargo.toml`: - -```toml -[dependencies] -termcolor = "1.1" -``` +Run `cargo add termcolor` to add this dependency to your `Cargo.toml` file. ### Organization @@ -47,8 +42,8 @@ analogous type for the Windows console is not provided since it cannot exist. ### Example: using `StandardStream` The `StandardStream` type in this crate works similarly to `std::io::Stdout`, -except it is augmented with methods for coloring by the `WriteColor` trait. -For example, to write some green text: +except it is augmented with methods for coloring by the `WriteColor` trait. For +example, to write some green text: ```rust use std::io::{self, Write}; @@ -98,8 +93,8 @@ termcolor will inspect the `TERM` and `NO_COLOR` environment variables: This decision procedure may change over time. Currently, `termcolor` does not attempt to detect whether a tty is present or -not. To achieve that, please use the [`atty`](https://crates.io/crates/atty) -crate. +not. To achieve that, please use +[`std::io::IsTerminal`](https://doc.rust-lang.org/std/io/trait.IsTerminal.html). ### Minimum Rust version policy |