diff --git a/crates/hyfetch/src/bin/hyfetch.rs b/crates/hyfetch/src/bin/hyfetch.rs index 7991f0e7..ee7e7d78 100644 --- a/crates/hyfetch/src/bin/hyfetch.rs +++ b/crates/hyfetch/src/bin/hyfetch.rs @@ -29,6 +29,7 @@ use hyfetch::presets::{AssignLightness, Preset}; use hyfetch::pride_month; use hyfetch::types::{AnsiMode, Backend, TerminalTheme}; use hyfetch::utils::{get_cache_path, input}; +use hyfetch::font_logo::get_font_logo; use indexmap::{IndexMap, IndexSet}; use itertools::Itertools as _; use palette::{LinSrgb, Srgb}; @@ -79,6 +80,12 @@ fn main() -> Result<()> { return Ok(()); } + if options.print_font_logo { + let logo = get_font_logo(backend).context("failed to get font logo")?; + writeln!(io::stdout(), "{}", logo).context("failed to write logo to stdout")?; + return Ok(()); + } + let config = if options.config { create_config(&options.config_file, distro, backend, debug_mode) .context("failed to create config")? diff --git a/crates/hyfetch/src/cli_options.rs b/crates/hyfetch/src/cli_options.rs index 76dce413..a4ec50c3 100644 --- a/crates/hyfetch/src/cli_options.rs +++ b/crates/hyfetch/src/cli_options.rs @@ -28,6 +28,7 @@ pub struct Options { pub debug: bool, pub distro: Option, pub ascii_file: Option, + pub print_font_logo: bool, pub test_print: bool, pub ask_exit: bool, } @@ -157,6 +158,10 @@ BACKEND={{{backends}}}", #[cfg(feature = "autocomplete")] let ascii_file = ascii_file.complete_shell(ShellComp::Nothing); let ascii_file = ascii_file.optional(); + let print_font_logo = long("print-font-logo") + .help("Print the Font Logo / Nerd Font icon of your distro and exit") + .switch(); + // hidden let test_print = long("test-print") .help("Print the ascii distro and exit") .switch() @@ -179,6 +184,7 @@ BACKEND={{{backends}}}", debug, distro, ascii_file, + print_font_logo, // hidden test_print, ask_exit,