diff --git a/README.md b/README.md index 6809ffc8..9a1b8748 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Astral
-Grafana +Grafana Labs
diff --git a/crates/zizmor/src/main.rs b/crates/zizmor/src/main.rs index 4891bdeb..2ff3f58e 100644 --- a/crates/zizmor/src/main.rs +++ b/crates/zizmor/src/main.rs @@ -7,7 +7,7 @@ use std::{ }; use annotate_snippets::{Level, Renderer}; -use anstream::{eprintln, stream::IsTerminal}; +use anstream::{eprintln, println, stream::IsTerminal}; use anyhow::{Context, Result, anyhow}; use audit::{Audit, AuditLoadError}; use camino::{Utf8Path, Utf8PathBuf}; @@ -23,6 +23,7 @@ use indicatif::ProgressStyle; use owo_colors::OwoColorize; use registry::{AuditRegistry, FindingRegistry, InputKey, InputKind, InputRegistry}; use state::AuditState; +use terminal_link::Link; use tracing::{Span, info_span, instrument}; use tracing_indicatif::{IndicatifLayer, span_ext::IndicatifSpanExt}; use tracing_subscriber::{EnvFilter, layer::SubscriberExt as _, util::SubscriberInitExt as _}; @@ -39,6 +40,10 @@ mod state; mod utils; mod yaml_patch; +// TODO: Dedupe this with the top-level `sponsors.json` used by the +// README + docs site. +const THANKS: &[(&str, &str)] = &[("Grafana Labs", "https://grafana.com")]; + /// Finds security issues in GitHub Actions setups. #[derive(Parser)] #[command(about, version)] @@ -133,6 +138,10 @@ struct App { #[arg(long, value_enum, value_name = "SHELL", exclusive = true)] completions: Option, + /// Emit thank-you messages for zizmor's sponsors. + #[arg(long, exclusive = true)] + thanks: bool, + /// Enable naches mode. #[arg(long, hide = true, env = "ZIZMOR_NACHES")] naches: bool, @@ -491,6 +500,15 @@ fn run() -> Result { let mut app = App::parse(); + if app.thanks { + println!("zizmor's development is sustained by our generous sponsors:"); + for (name, url) in THANKS { + let link = Link::new(name, url); + println!("🌈 {link}") + } + return Ok(ExitCode::SUCCESS); + } + if let Some(shell) = app.completions { let mut cmd = App::command(); completions(shell, &mut cmd); diff --git a/docs/snippets/help.txt b/docs/snippets/help.txt index 8e057289..563b5dfd 100644 --- a/docs/snippets/help.txt +++ b/docs/snippets/help.txt @@ -46,6 +46,8 @@ Options: Fail instead of warning on syntax and schema errors in collected inputs --completions Generate tab completion scripts for the specified shell [possible values: bash, elvish, fish, nushell, powershell, zsh] + --thanks + Emit thank-you messages for zizmor's sponsors -h, --help Print help (see more with '--help') -V, --version diff --git a/docs/snippets/sponsors.html b/docs/snippets/sponsors.html index c7714150..55e5475a 100644 --- a/docs/snippets/sponsors.html +++ b/docs/snippets/sponsors.html @@ -14,7 +14,7 @@ Astral
-Grafana +Grafana Labs
diff --git a/docs/snippets/sponsors.json b/docs/snippets/sponsors.json index bf28a05b..3a260191 100644 --- a/docs/snippets/sponsors.json +++ b/docs/snippets/sponsors.json @@ -5,7 +5,7 @@ "img": "https://avatars.githubusercontent.com/u/115962839?s=100&v=4" }, { - "name": "Grafana", + "name": "Grafana Labs", "url": "https://grafana.com/", "img": "https://avatars.githubusercontent.com/u/7195757?s=100&v=4" },