diff --git a/server/src/option.rs b/server/src/option.rs index b41ad3dc3..c9835e87b 100644 --- a/server/src/option.rs +++ b/server/src/option.rs @@ -26,6 +26,7 @@ use crate::storage::{ FSConfig, ObjectStorage, ObjectStorageError, ObjectStorageProvider, S3Config, LOCAL_SYNC_INTERVAL, }; +use crate::utils::capitalize_ascii; lazy_static::lazy_static! { #[derive(Debug)] @@ -38,6 +39,7 @@ pub const PASSWORD_ENV: &str = "P_PASSWORD"; pub struct Config { pub parseable: Server, storage: Arc, + pub storage_name: &'static str, } impl Config { @@ -47,10 +49,12 @@ impl Config { SubCmd::ServerS3 { server, storage } => Config { parseable: server, storage: Arc::new(storage), + storage_name: "s3", }, SubCmd::ServerDrive { server, storage } => Config { parseable: server, storage: Arc::new(storage), + storage_name: "drive", }, } } @@ -105,10 +109,11 @@ impl Config { eprintln!( " {} - Local Data Path: {} - Object Storage: {}", + Local Staging Path: {} + {} Storage: {}", "Storage:".to_string().blue().bold(), self.staging_dir().to_string_lossy(), + capitalize_ascii(self.storage_name), self.storage().get_endpoint(), ) } diff --git a/server/src/utils.rs b/server/src/utils.rs index 80edde5c9..e4667bb75 100644 --- a/server/src/utils.rs +++ b/server/src/utils.rs @@ -129,6 +129,10 @@ pub fn hostname_unchecked() -> String { hostname::get().unwrap().into_string().unwrap() } +pub fn capitalize_ascii(s: &str) -> String { + s[0..1].to_uppercase() + &s[1..] +} + pub mod uuid { use uuid::Uuid;