use cli_boxes::{BorderStyle, BoxChars};
fn main() {
println!("=== CLI Boxes Demo ===\n");
let custom = BoxChars::new('*', '-', '*', '|', '*', '-', '*', '|');
println!("Custom box (new constructor): {}", custom);
let builder_box = BoxChars::builder()
.corners('●')
.horizontal('─')
.vertical('│')
.build();
println!("Builder pattern box: {}", builder_box);
let asymmetric = BoxChars::builder()
.top_left('╭')
.top_right('╮')
.bottom_left('╰')
.bottom_right('╯')
.horizontal('─')
.vertical('│')
.build();
println!("Asymmetric box: {}", asymmetric);
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),
}
}
println!("\nError handling:");
match "invalid_style".parse::<BorderStyle>() {
Ok(_) => println!(" Unexpected success"),
Err(e) => println!(" {}", e),
}
let default_box = BoxChars::default();
println!("\nDefault box: {}", default_box);
println!("\nAll predefined styles:");
for style in BorderStyle::all() {
let chars = style.chars();
println!(" {:12} -> {}", format!("{:?}", style), chars);
}
}