4 releases (2 stable)

1.1.0 Jun 18, 2022
1.0.0 Jan 20, 2022
0.1.3 Oct 18, 2020
0.1.2 Oct 18, 2020

#574 in Command-line interface


Used in 2 crates

MIT license

22KB
405 lines

terminal.rs

Utilities for interacting with a terminal.


lib.rs:

Utilities for interacting with a terminal.

The most common use for this package is to style a string to output to the terminal.

use dinglebit_terminal::style;
fn main() {
    let s = style!("{}, {}!", "Hello", "world")
                .black()
                .underline()
                .to_string();
    assert_eq!(s, "\x1b[30;4mHello, world!\x1b[0m");
}

You can apply foreground and background colors as well as various attributes like bold, itlic, underline, etc.

No runtime deps