Report back more detailed results from commands

This commit was merged in pull request #41.
This commit is contained in:
2024-08-07 23:33:07 +02:00
parent 21c1f8cc87
commit 7e71b5071f
4 changed files with 99 additions and 37 deletions

View File

@@ -1,6 +1,7 @@
#[macro_use]
extern crate prettytable;
use core::common::CommandStatus;
#[cfg(feature = "mysql-admutils-compatibility")]
use std::path::PathBuf;
@@ -73,9 +74,26 @@ async fn main() -> anyhow::Result<()> {
};
match result {
Ok(_) => println!("Changes committed to database"),
Err(_) => println!("Changes reverted due to error"),
Ok(CommandStatus::SuccessfullyModified) => {
println!("Modifications committed successfully");
Ok(())
}
Ok(CommandStatus::PartiallySuccessfullyModified) => {
println!("Some modifications committed successfully");
Ok(())
}
Ok(CommandStatus::NoModificationsNeeded) => {
println!("No modifications made");
Ok(())
}
Ok(CommandStatus::NoModificationsIntended) => {
/* Don't report anything */
Ok(())
}
Ok(CommandStatus::Cancelled) => {
println!("Command cancelled successfully");
Ok(())
}
Err(e) => Err(e),
}
result
}