1use regex::Regex;
2use std::borrow::Cow;
3use std::sync::LazyLock;
4
5#[cfg(feature = "cli-help")]
6pub mod cli;
7#[cfg(feature = "cli-help")]
8mod layout;
9pub(crate) mod logo;
11#[cfg(feature = "manpage")]
12pub mod manpage;
13#[cfg(feature = "markdown")]
14pub mod markdown;
15#[cfg(feature = "cli-help")]
16pub(crate) mod models;
17
18static ANSI_CSI: LazyLock<Regex> =
21 LazyLock::new(|| Regex::new(r"\x1b\[[0-?]*[ -/]*[@-~]").unwrap());
22
23pub(crate) fn strip_ansi(value: &str) -> Cow<'_, str> {
24 ANSI_CSI.replace_all(value, "")
25}