Check if an email address exists without sending any email, written in Rust. Comes with a ⚙️ HTTP backend.
Rust emailemail-validationemail-validation-apiemail-verificationemail-verification-apiemail-verifierhacktoberfest
Add cli to the program
Amaury Martinya9d832df2a20
diff --git a/Cargo.lock b/Cargo.lockindex 2f3254d7..33f18764 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -1,4 +1,137 @@+[[package]]+name = "ansi_term"+version = "0.11.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+dependencies = [+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",+]++[[package]]+name = "atty"+version = "0.2.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+dependencies = [+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",+ "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",+]++[[package]]+name = "bitflags"+version = "1.0.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+[[package]]name = "check-if-email-exists"version = "0.1.0"+dependencies = [+ "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",+]++[[package]]+name = "clap"+version = "2.32.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+dependencies = [+ "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",+ "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",+ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",+ "strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",+ "textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",+ "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",+ "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",+ "yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",+]++[[package]]+name = "libc"+version = "0.2.43"+source = "registry+https://github.com/rust-lang/crates.io-index"++[[package]]+name = "redox_syscall"+version = "0.1.40"+source = "registry+https://github.com/rust-lang/crates.io-index"++[[package]]+name = "redox_termios"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+dependencies = [+ "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",+]++[[package]]+name = "strsim"+version = "0.7.0"+source = "registry+https://github.com/rust-lang/crates.io-index"++[[package]]+name = "termion"+version = "1.5.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+dependencies = [+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",+ "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",+ "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",+]++[[package]]+name = "textwrap"+version = "0.10.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+dependencies = [+ "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",+]++[[package]]+name = "unicode-width"+version = "0.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"++[[package]]+name = "vec_map"+version = "0.8.1"+source = "registry+https://github.com/rust-lang/crates.io-index"++[[package]]+name = "winapi"+version = "0.3.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+dependencies = [+ "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",+ "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",+]++[[package]]+name = "winapi-i686-pc-windows-gnu"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"++[[package]]+name = "winapi-x86_64-pc-windows-gnu"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"++[[package]]+name = "yaml-rust"+version = "0.3.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+[metadata]+"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"+"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"+"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"+"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e"+"checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d"+"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1"+"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"+"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"+"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"+"checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6"+"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526"+"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"+"checksum winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "773ef9dcc5f24b7d850d0ff101e542ff24c3b090a9768e03ff889fdef41f00fd"+"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"+"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"+"checksum yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992"diff --git a/Cargo.toml b/Cargo.tomlindex 56cfe2a5..ca784604 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -4,3 +4,4 @@ version = "0.1.0"authors = ["Amaury Martiny <[email protected]>"][dependencies]+clap = {version = "2.32", features = ["yaml"]}diff --git a/src/cli.yml b/src/cli.ymlnew file mode 100644index 00000000..e614ee35--- /dev/null+++ b/src/cli.yml@@ -0,0 +1,13 @@+name: check-if-email-exists+version: '0.1.0'+author: Amaury Martiny <[email protected]>+about: Check if an email address exists without sending any email.+args:+ - verbose:+ short: v+ long: verbose+ help: The program will tell you everything it does+ - EMAIL:+ help: The email to check+ required: true+ index: 1diff --git a/src/main.rs b/src/main.rsindex e7a11a96..60d87558 100644--- a/src/main.rs+++ b/src/main.rs@@ -1,3 +1,14 @@+#[macro_use]+extern crate clap;+use clap::App;+fn main() {- println!("Hello, world!");+ // The YAML file is found relative to the current file, similar to how modules are found+ let yaml = load_yaml!("cli.yml");+ let matches = App::from_yaml(yaml).get_matches();++ // Calling .unwrap() is safe here because "EMAIL" is required+ let email = matches.value_of("EMAIL").unwrap();++ println!("{}", email)}