common: dedup and move banner to common/logging (#2846)
This commit is contained in:
+2
-19
@@ -6,7 +6,7 @@ extern crate rocket;
|
||||
|
||||
use ::config::defaults::setup_env;
|
||||
use build_information::BinaryBuildInformation;
|
||||
use clap::{crate_version, Parser, ValueEnum};
|
||||
use clap::{crate_name, crate_version, Parser, ValueEnum};
|
||||
use lazy_static::lazy_static;
|
||||
use logging::setup_logging;
|
||||
|
||||
@@ -64,7 +64,7 @@ impl Cli {
|
||||
async fn main() {
|
||||
setup_logging();
|
||||
if atty::is(atty::Stream::Stdout) {
|
||||
println!("{}", banner());
|
||||
println!("{}", logging::banner(crate_name!(), crate_version!()));
|
||||
}
|
||||
|
||||
let args = Cli::parse();
|
||||
@@ -72,23 +72,6 @@ async fn main() {
|
||||
commands::execute(args).await;
|
||||
}
|
||||
|
||||
fn banner() -> String {
|
||||
format!(
|
||||
r#"
|
||||
|
||||
_ __ _ _ _ __ ___
|
||||
| '_ \| | | | '_ \ _ \
|
||||
| | | | |_| | | | | | |
|
||||
|_| |_|\__, |_| |_| |_|
|
||||
|___/
|
||||
|
||||
(mixnode - version {:})
|
||||
|
||||
"#,
|
||||
crate_version!()
|
||||
)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user