Refactoring for Show/Delete handlers

Refactor the existing code architecture to be a little flatter to support adding the show and delete handlers.  Currently these two handlers are just stubbed functions, but the CLI looks about right.
This commit is contained in:
Anthony Oteri
2023-09-20 16:38:24 -04:00
parent 6f44b77a6d
commit 3768401faf
7 changed files with 201 additions and 235 deletions
+7 -3
View File
@@ -103,9 +103,13 @@ async fn main() -> Result<(), DredgeError> {
let config = Config::try_from(config_file.as_ref())?;
match args.command {
Commands::Catalog => commands::catalog::handler(&config).await?,
Commands::Tags { name } => commands::tags::handler(&config, &name).await?,
Commands::Check => commands::version::handler(&config).await?,
Commands::Catalog => commands::catalog_handler(&config).await?,
Commands::Tags { name } => commands::tags_handler(&config, &name).await?,
Commands::Show { image, tag } => {
commands::show_handler(&config, &image, &tag.unwrap_or("latest".to_string())).await?
}
Commands::Delete { image, tag } => commands::delete_handler(&config, &image, &tag).await?,
Commands::Check => commands::check_handler(&config).await?,
}
Ok(())