From 2f9fa08cf255dd873ed1f63945d1eda1abfa4a5f Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 8 Dec 2023 03:25:15 +0900 Subject: [PATCH] storages.yml check --- src/main.rs | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/main.rs b/src/main.rs index 89296e2..65c5a7e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -326,19 +326,25 @@ fn main() -> Result<()> { } println!("The name {} is already used.", name); } - let provider = Text::new("Provider:").prompt().context("Failed to get provider")?; + let provider = Text::new("Provider:") + .prompt() + .context("Failed to get provider")?; let capacity: u64 = CustomType::::new("Capacity (byte):") .with_error_message("Please type number.") .prompt() .context("Failed to get capacity.")?; - let alias = Text::new("Alias:").prompt().context("Failed to get provider")?; + let alias = Text::new("Alias:") + .prompt() + .context("Failed to get provider")?; let storage = OnlineStorage::new( - name.clone(), provider, capacity, alias, path, &device, - ); - ( - name, - Storage::Online(storage), - ) + name.clone(), + provider, + capacity, + alias, + path, + &device, + ); + (name, Storage::Online(storage)) } }; @@ -418,7 +424,11 @@ fn main() -> Result<()> { Commands::Sync {} => { unimplemented!("Sync is not implemented") } - Commands::Check {} => todo!(), + Commands::Check {} => { + println!("Config dir: {}", &config_dir.display()); + let _storages = storages::get_storages(&config_dir).context("Failed to parse storages file."); + todo!() + }, } full_status(&Repository::open(&config_dir)?)?; Ok(())