util/cli: Add macro for cli description for use with clap::about.

This commit is contained in:
parazyd
2022-04-02 15:34:58 +02:00
parent 236e1bacb9
commit 35fe9e66a9

View File

@@ -97,3 +97,14 @@ impl TryFrom<UrlConfig> for url::Url {
Ok(url)
}
}
pub const ANSI_LOGO: &str = include_str!("../../contrib/darkfi.ansi");
#[macro_export]
macro_rules! cli_desc {
() => {{
let mut desc = env!("CARGO_PKG_DESCRIPTION").to_string();
desc.push_str(darkfi::util::cli::ANSI_LOGO);
Box::leak(desc.into_boxed_str()) as &'static str
}};
}