clicolors-control 1.0.1

A common utility library to control CLI colorization
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Auxiliary terminal information.
//!
//! These are internal functions exported to come to the same conclusions as
//! clicolors-control about terminal and color support if that is wanted.

use common;

/// Returns `true` if colors are supported by this terminal.
pub fn supports_colors() -> bool {
    common::is_a_color_terminal()
}

/// Returns `true` if a terminal is connected.
///
/// This uses a best effort check
pub fn is_atty() -> bool {
    common::is_a_terminal()
}