From 0c1b7b89b025aacfe12a418e067f449a9a0946fa Mon Sep 17 00:00:00 2001 From: Catherine Noll Date: Sat, 20 Mar 2021 19:26:50 -0500 Subject: Cycle through a constant list of themes --- src/main.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/main.rs b/src/main.rs index 35662b45..8fd8dd10 100644 --- a/src/main.rs +++ b/src/main.rs @@ -305,7 +305,27 @@ where } } +const THEMES: [&'static str; 4] = [ + "collared-trogon", + "tangara-chilensis", + "villsau", + "woolly-mammoth", +]; + fn show_themes() -> std::io::Result<()> { + let mut output_type = OutputType::from_mode( + PagingMode::QuitIfOneScreen, + None, + &config::Config::from(cli::Opt::default()), + ) + .unwrap(); + let title_style = ansi_term::Style::new().bold(); + let writer = output_type.handle().unwrap(); + + for theme in &THEMES { + writeln!(writer, "\n\nTheme: {}\n", title_style.paint(*theme))?; + } + Ok(()) } -- cgit v1.2.3