41 lines
1.4 KiB
Rust
41 lines
1.4 KiB
Rust
//! List of all success messages possible
|
|
|
|
use colored::*;
|
|
use derive_more::Display;
|
|
use lib_efo::epoch::EpochId;
|
|
|
|
#[derive(Display, Clone, Debug)]
|
|
#[allow(missing_docs, clippy::missing_docs_in_private_items)]
|
|
pub enum SuccessMessages {
|
|
#[display("Switched to epoch {_0}")]
|
|
EpochSwitchSuccess(lib_efo::epoch::EpochId),
|
|
|
|
#[display("All future events deleted - back to epoch {_0}")]
|
|
DeletedAllFutureEvents(lib_efo::epoch::EpochId),
|
|
|
|
#[display("The folder was initialized as an epoch folder")]
|
|
FolderInitializedSuccessfully(&'static str),
|
|
|
|
#[display("Changed the summary of epoch {_0} with: '{_1}'")]
|
|
ChangedSummary(EpochId, String),
|
|
|
|
#[display("Successfully computed the new epoch. The current epoch is now {_1} (was {_0})")]
|
|
EpochNextSuccess(EpochId, EpochId),
|
|
|
|
#[display("Successfully deleted the entity {_0} ({_1} [{_2}])")]
|
|
DeletedEntity(String, String, String),
|
|
|
|
#[display("Successfully created the entity {_0} ({_1} [{_2}])")]
|
|
CreatedEntity(String, String, String),
|
|
|
|
#[display("Successfully edited the entity {_0} ({_1} [{_2}])")]
|
|
EditedEntity(String, String, String),
|
|
#[display("Showing delta between Epoch ({_0} & {_1})")]
|
|
DiffBetweenEpoch(lib_efo::epoch::EpochId, lib_efo::epoch::EpochId),
|
|
}
|
|
|
|
/// Display the success message to stdout
|
|
pub fn display_success(message: &SuccessMessages) {
|
|
println!("{}", message.to_string().cyan())
|
|
}
|