Skip to main content

guild_cli/
output.rs

1use colored::Colorize;
2
3/// Print a success message.
4pub fn print_success(msg: &str) {
5    println!("{} {msg}", "✓".green().bold());
6}
7
8/// Print an error message to stderr.
9pub fn print_error(msg: &str) {
10    eprintln!("{} {msg}", "error:".red().bold());
11}
12
13/// Print a warning message to stderr.
14pub fn print_warning(msg: &str) {
15    eprintln!("{} {msg}", "warning:".yellow().bold());
16}
17
18/// Print a "not yet implemented" stub message.
19pub fn print_not_implemented(command: &str) {
20    print_warning(&format!("'{command}' is not yet implemented"));
21}
22
23/// Print a section header.
24pub fn print_header(title: &str) {
25    println!("\n{}", title.bold().underline());
26}
27
28/// Print a project list entry.
29pub fn print_project_entry(name: &str, path: &str, tags: &[String]) {
30    let tag_str = if tags.is_empty() {
31        String::new()
32    } else {
33        format!(" [{}]", tags.join(", ").dimmed())
34    };
35    println!("  {} {}{tag_str}", name.cyan(), path.dimmed());
36}