Skip to content

Commit 697a31b

Browse files
authored
Banner fix (#221)
1 parent 4702085 commit 697a31b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

server/src/option.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ use crate::storage::{
2626
FSConfig, ObjectStorage, ObjectStorageError, ObjectStorageProvider, S3Config,
2727
LOCAL_SYNC_INTERVAL,
2828
};
29+
use crate::utils::capitalize_ascii;
2930

3031
lazy_static::lazy_static! {
3132
#[derive(Debug)]
@@ -38,6 +39,7 @@ pub const PASSWORD_ENV: &str = "P_PASSWORD";
3839
pub struct Config {
3940
pub parseable: Server,
4041
storage: Arc<dyn ObjectStorageProvider + Send + Sync>,
42+
pub storage_name: &'static str,
4143
}
4244

4345
impl Config {
@@ -47,10 +49,12 @@ impl Config {
4749
SubCmd::ServerS3 { server, storage } => Config {
4850
parseable: server,
4951
storage: Arc::new(storage),
52+
storage_name: "s3",
5053
},
5154
SubCmd::ServerDrive { server, storage } => Config {
5255
parseable: server,
5356
storage: Arc::new(storage),
57+
storage_name: "drive",
5458
},
5559
}
5660
}
@@ -105,10 +109,11 @@ impl Config {
105109
eprintln!(
106110
"
107111
{}
108-
Local Data Path: {}
109-
Object Storage: {}",
112+
Local Staging Path: {}
113+
{} Storage: {}",
110114
"Storage:".to_string().blue().bold(),
111115
self.staging_dir().to_string_lossy(),
116+
capitalize_ascii(self.storage_name),
112117
self.storage().get_endpoint(),
113118
)
114119
}

server/src/utils.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ pub fn hostname_unchecked() -> String {
129129
hostname::get().unwrap().into_string().unwrap()
130130
}
131131

132+
pub fn capitalize_ascii(s: &str) -> String {
133+
s[0..1].to_uppercase() + &s[1..]
134+
}
135+
132136
pub mod uuid {
133137
use uuid::Uuid;
134138

0 commit comments

Comments
 (0)