diff options
author | Catherine Noll <noll.catherine@gmail.com> | 2021-03-20 19:26:50 -0500 |
---|---|---|
committer | Catherine Noll <noll.catherine@gmail.com> | 2021-03-20 22:53:31 -0500 |
commit | 0c1b7b89b025aacfe12a418e067f449a9a0946fa (patch) | |
tree | cb80441217bcd617d01f7911f245c39951e3c853 | |
parent | 587a01ea976dcebadfc5a15b32344fb20b2c96e6 (diff) |
Cycle through a constant list of themes
-rw-r--r-- | src/main.rs | 20 |
1 files changed, 20 insertions, 0 deletions
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(()) } |