theater_cli/utils/
formatting.rs1use console::style;
2
3pub fn format_section(title: &str) -> String {
5 format!(
6 "\n{}\n{}",
7 style(title).bold().underlined(),
8 style("─".repeat(title.len())).dim()
9 )
10}
11
12pub fn format_key_value(key: &str, value: &str) -> String {
14 format!("{}: {}", style(key).bold(), value)
15}
16
17pub fn format_success(message: &str) -> String {
19 format!("{} {}", style("✓").green().bold(), message)
20}
21
22pub fn format_error(message: &str) -> String {
24 format!("{} {}", style("✗").red().bold(), message)
25}
26
27pub fn format_info(message: &str) -> String {
29 format!("{} {}", style("ℹ").blue().bold(), message)
30}
31
32pub fn format_warning(message: &str) -> String {
34 format!("{} {}", style("⚠").yellow().bold(), message)
35}