//! `repo-labels [pattern]` — list the active repo's full label set //! (project-wide), not the labels on one issue/PR (that's `labels //! `). Useful for triage / labelling to discover the valid label //! names + what each means before applying them. use anyhow::Result; use clap::Args as ClapArgs; use forgejo_api::structs::{IssueListLabelsQuery, Label}; use crate::client::Client; use crate::verbs::print_json; /// Page size on the label list endpoint. const PAGE_SIZE: u32 = 50; /// Runaway cap on label pagination — same ceiling the raw client used. const MAX_PAGES: u32 = 10; #[derive(ClapArgs)] pub struct Args { /// Substring pattern to filter label names (case-sensitive). pattern: Option, } pub fn run(client: &Client, args: Args) -> Result<()> { let (owner, name) = client.owner_repo()?; // Repos can carry more than one page of labels; paginate so the list // is complete rather than capped at the first page. let mut labels: Vec