diff --git a/.gitignore b/.gitignore index 3ad8bcc..f699726 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ Cargo.lock /target .env +.idea \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 3348410..95d77bd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,13 @@ name = "dumpsync" version = "0.1.0" edition = "2021" +license = "MIT" +authors = ["kremilly"] +keywords = ["mysql", "dump", "restore", "backup"] +description = "A simple tool for dump and restore a MySQL database. It can be used for backup and restore purposes, or for transferring a database from one server to another." +repository = "https://github.com/kremilly/DumpSync" +documentation = "https://kremilly.com/docs/dumpsync" +homepage = "https://kremilly.com" [dependencies] chrono = "0.4.38" @@ -11,4 +18,3 @@ ctrlc = "3.4.5" dotenvy = "0.15.7" figlet-rs = "0.1.5" rand = "0.8.5" -uuid = { version = "1.11.0", features = ["v4"] } diff --git a/src/dumpsync.rs b/src/dump_sync.rs similarity index 94% rename from src/dumpsync.rs rename to src/dump_sync.rs index 345d76d..78da27f 100644 --- a/src/dumpsync.rs +++ b/src/dump_sync.rs @@ -36,7 +36,7 @@ impl DumpSync { Env::get_var("DS_DUMP_PATH") }; - UI::label("Press CTRL+C to exit the tool", "info"); + UI::label("Press CTRL+C to exit the tool", "normal"); UI::section_header("Dumping the database", "info"); diff --git a/src/engine/dump.rs b/src/engine/dump.rs index 9227e50..1bb94a9 100644 --- a/src/engine/dump.rs +++ b/src/engine/dump.rs @@ -33,9 +33,9 @@ use crate::{ pub struct Dump { user: String, - password: String, - dbname: String, interval: u64, + dbname: String, + password: String, dump_file_path: String, } diff --git a/src/engine/env.rs b/src/engine/env.rs index 595dcb7..9e63c23 100644 --- a/src/engine/env.rs +++ b/src/engine/env.rs @@ -18,8 +18,4 @@ impl Env { env::var(var).expect(&format!("{} is not defined in the .env", var)).parse().expect(&format!("{} is not a valid number", var)) } - pub fn get_var_bool(var: &str) -> bool { - env::var(var).expect(&format!("{} is not defined in the .env", var)).parse().expect(&format!("{} is not a valid boolean", var)) - } - } \ No newline at end of file diff --git a/src/engine/mod.rs b/src/engine/mod.rs index bd204bc..1c6ca00 100644 --- a/src/engine/mod.rs +++ b/src/engine/mod.rs @@ -1,2 +1,2 @@ -pub mod dump; -pub mod env; \ No newline at end of file +pub mod env; +pub mod dump; \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 969dbfd..04c7aa6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,10 +1,10 @@ -pub mod ui; -pub mod utils; -pub mod engine; -pub mod args_cli; -pub mod dumpsync; +mod ui; +mod utils; +mod engine; +mod args_cli; +mod dump_sync; -use dumpsync::DumpSync; +use crate::dump_sync::DumpSync; fn main() { DumpSync::init(); diff --git a/src/ui/ui_base.rs b/src/ui/ui_base.rs index a8a106b..9209954 100644 --- a/src/ui/ui_base.rs +++ b/src/ui/ui_base.rs @@ -27,13 +27,20 @@ impl UI { if let Some(title) = standard_font.convert(&name) { println!("{}", &title.to_string().bold().cyan()); + + println!( + "Version: {} | Author: {} | License: {} | Home: {}", + + env!("CARGO_PKG_VERSION").bold().green(), + env!("CARGO_PKG_AUTHORS").bold().cyan(), + env!("CARGO_PKG_LICENSE").bold().blue(), + env!("CARGO_PKG_HOMEPAGE").bold().yellow() + ); } } pub fn section_header(text: &str, level: &str) { - let text = text.to_uppercase(); - let message = Self::colorize(&text, level); - + let message = Self::colorize(&text.to_uppercase(), level); println!("\n{}\n", message); }