mirror of
https://github.com/Xyverle/neutuino.git
synced 2026-08-31 07:30:04 -04:00
Add terminal check in examples
This commit is contained in:
@@ -2,12 +2,15 @@
|
||||
|
||||
use neutuino::prelude::*;
|
||||
use std::{io, time::Duration};
|
||||
use std::io::IsTerminal;
|
||||
|
||||
fn print_line_style_reset(string: &str) {
|
||||
println!("{}{}{}", string, STYLE_RESET, move_cursor_to_column(0));
|
||||
}
|
||||
|
||||
fn main() -> io::Result<()> {
|
||||
assert!(io::stdout().is_terminal(), "Not running in a terminal");
|
||||
|
||||
let all_styles = format!("{STYLE_BOLD}{STYLE_ITALIC}{STYLE_UNDERLINE}");
|
||||
|
||||
enable_ansi()?;
|
||||
|
||||
Reference in New Issue
Block a user