cli-boxes 0.1.1

Unicode box drawing characters for creating beautiful CLI interfaces
Documentation
use cli_boxes::{BorderStyle, BoxChars};

fn main() {
    println!("=== CLI Boxes Demo ===\n");

    // Test the new constructor
    let custom = BoxChars::new('*', '-', '*', '|', '*', '-', '*', '|');
    println!("Custom box (new constructor): {}", custom);

    // Test the builder pattern
    let builder_box = BoxChars::builder()
        .corners('')
        .horizontal('')
        .vertical('')
        .build();
    println!("Builder pattern box: {}", builder_box);

    // Test asymmetric builder
    let asymmetric = BoxChars::builder()
        .top_left('')
        .top_right('')
        .bottom_left('')
        .bottom_right('')
        .horizontal('')
        .vertical('')
        .build();
    println!("Asymmetric box: {}", asymmetric);

    // Test string parsing (optimized version)
    let styles = [
        "single",
        "DOUBLE",
        "round",
        "single-double",
        "double_single",
    ];
    println!("\nParsing border styles:");
    for style_str in &styles {
        match style_str.parse::<BorderStyle>() {
            Ok(style) => {
                let chars = BoxChars::from(style);
                println!("  '{}' -> {}", style_str, chars);
            }
            Err(e) => println!("  '{}' -> Error: {}", style_str, e),
        }
    }

    // Test error handling
    println!("\nError handling:");
    match "invalid_style".parse::<BorderStyle>() {
        Ok(_) => println!("  Unexpected success"),
        Err(e) => println!("  {}", e),
    }

    // Test default
    let default_box = BoxChars::default();
    println!("\nDefault box: {}", default_box);

    // Test Display trait
    println!("\nAll predefined styles:");
    for style in BorderStyle::all() {
        let chars = style.chars();
        println!("  {:12} -> {}", format!("{:?}", style), chars);
    }
}