mirror of
https://github.com/qwjyh/xdbm
synced 2024-11-22 14:50:12 +09:00
storages.yml check
This commit is contained in:
parent
5f81eccd2d
commit
2f9fa08cf2
1 changed files with 19 additions and 9 deletions
26
src/main.rs
26
src/main.rs
|
@ -326,19 +326,25 @@ fn main() -> Result<()> {
|
||||||
}
|
}
|
||||||
println!("The name {} is already used.", name);
|
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::<u64>::new("Capacity (byte):")
|
let capacity: u64 = CustomType::<u64>::new("Capacity (byte):")
|
||||||
.with_error_message("Please type number.")
|
.with_error_message("Please type number.")
|
||||||
.prompt()
|
.prompt()
|
||||||
.context("Failed to get capacity.")?;
|
.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(
|
let storage = OnlineStorage::new(
|
||||||
name.clone(), provider, capacity, alias, path, &device,
|
name.clone(),
|
||||||
|
provider,
|
||||||
|
capacity,
|
||||||
|
alias,
|
||||||
|
path,
|
||||||
|
&device,
|
||||||
);
|
);
|
||||||
(
|
(name, Storage::Online(storage))
|
||||||
name,
|
|
||||||
Storage::Online(storage),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -418,7 +424,11 @@ fn main() -> Result<()> {
|
||||||
Commands::Sync {} => {
|
Commands::Sync {} => {
|
||||||
unimplemented!("Sync is not implemented")
|
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)?)?;
|
full_status(&Repository::open(&config_dir)?)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Reference in a new issue