termcinema-cli 0.1.0

🎬 Animated terminal-to-SVG renderer CLI for the termcinema project
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use atty::{Stream, is};

/// Returns `true` if standard input is piped (non-interactive).
///
/// This distinguishes interactive terminal input from piped data (e.g. via `echo`, `cat`, etc).
///
/// Internally uses the [`atty`] crate to check the TTY status of `stdin`.
///
/// # Example:
/// ```bash
/// echo "Hello" | termcinema      # → true
/// termcinema                     # → false
/// ```
pub(crate) fn stdin_has_data() -> bool {
    !is(Stream::Stdin)
}