Skip to main content

harmont_cli/output/
status.rs

1#![allow(
2    clippy::print_stdout,
3    clippy::print_stderr,
4    reason = "this module is the centralised print sink for the CLI"
5)]
6
7use owo_colors::OwoColorize;
8
9/// Print a success message.
10pub fn print_success(msg: &str) {
11    let check = format!("{}", "\u{2714}".green().bold());
12    println!("{check} {msg}");
13}
14
15/// Print a warning message.
16pub fn print_warning(msg: &str) {
17    let bang = format!("{}", "!".yellow().bold());
18    eprintln!("{bang} {msg}");
19}
20
21/// Print an error message.
22pub fn print_error(msg: &str) {
23    let cross = format!("{}", "\u{2718}".red().bold());
24    eprintln!("{cross} {msg}");
25}
26
27/// Print an info message.
28pub fn print_info(msg: &str) {
29    let arrow = format!("{}", "\u{25b6}".cyan());
30    println!("{arrow} {msg}");
31}