diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ad61c0..7351581 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.3.5] - 2022-09-29 + +### Fixed + +- Bump dependencies + ## [0.3.4] - 2022-09-21 ### Fixed diff --git a/Cargo.toml b/Cargo.toml index 38e38e4..2977219 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "git2mail" -version = "0.3.4" +version = "0.3.5" authors = ["exti0p"] edition = "2021" license = "LGPL-3.0-only" @@ -13,14 +13,14 @@ categories = ["command-line-utilities"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -clap = "3.2.12" -itertools = "0.10.3" +clap = "4.0.4" +itertools = "0.10.5" lazy_static = "1.4.0" -openssl = { version = "0.10.41", features = ["vendored"] } +openssl = { version = "0.10.42", features = ["vendored"] } regex = "1.6.0" -reqwest = { version = "0.11.11", features = ["blocking", "json"] } -serde = { version = "1.0.139", features = ["derive"] } -serde_json = "1.0.82" +reqwest = { version = "0.11.12", features = ["blocking", "json"] } +serde = { version = "1.0.145", features = ["derive"] } +serde_json = "1.0.85" # logging log = "0.4.17" diff --git a/src/main.rs b/src/main.rs index d864644..8bf93d1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,69 +11,75 @@ use controller::{Search, SearchTrait}; fn run() { log::info!("Starting git2mail!"); - let argv: ArgMatches = Command::new("git2mail") - .author("exti0p") - .about("Pure Rust OSINT tool to find a GitHub user's email") - .arg( - Arg::new("url") - .short('u') - .long("url") - .help("GitHub repository or profile URL you want to scan") - .takes_value(true), - ) - .arg( - Arg::new("query") - .short('q') - .long("query") - .help("Query to find interesting GitHub repositories for you") - .takes_value(true), - ) - .arg( - Arg::new("language") - .short('l') - .long("language") - .help("Select a language to enhance your repository searches") - .takes_value(true), - ) - .arg( - Arg::new("limit") - .long("limit") - .default_value("5") - .help("Defines the limit of scanned repositories") - .takes_value(true), - ) - .arg( - Arg::new("token") - .short('t') - .long("token") - .help("Authenticate to the GitHub API with your GitHub token") - .takes_value(true), - ) - .arg( - Arg::new("token-file") - .long("token-file") - .help( - "JSON file that contains your GitHub tokens to authenticate to the GitHub API", - ) - .takes_value(true), - ) - .get_matches(); + let argv: ArgMatches = + Command::new("git2mail") + .author("exti0p") + .about("Pure Rust OSINT tool to find a GitHub user's email") + .arg( + Arg::new("url") + .short('u') + .long("url") + .help("GitHub repository or profile URL you want to scan"), + ) + .arg( + Arg::new("query") + .short('q') + .long("query") + .help("Query to find interesting GitHub repositories for you"), + ) + .arg( + Arg::new("language") + .short('l') + .long("language") + .help("Select a language to enhance your repository searches"), + ) + .arg( + Arg::new("limit") + .long("limit") + .default_value("5") + .help("Defines the limit of scanned repositories"), + ) + .arg( + Arg::new("token") + .short('t') + .long("token") + .help("Authenticate to the GitHub API with your GitHub token"), + ) + .arg(Arg::new("token-file").long("token-file").help( + "JSON file that contains your GitHub tokens to authenticate to the GitHub API", + )) + .get_matches(); + + let url: String = argv + .get_one::("url") + .unwrap_or(&"".to_string()) + .to_string(); + let query: String = argv + .get_one::("query") + .unwrap_or(&"".to_string()) + .to_string(); let mut search = ::new( - argv.value_of("url").unwrap_or_default().to_string(), - argv.value_of("query").unwrap_or_default().to_string(), - argv.value_of("language").unwrap_or_default().to_string(), - argv.value_of("token").unwrap_or_default().to_string(), - argv.value_of("token-file").unwrap_or_default().to_string(), - argv.value_of("limit") - .unwrap_or_default() + url.clone(), + query.clone(), + argv.get_one::("language") + .unwrap_or(&"".to_string()) + .to_string(), + argv.get_one::("token") + .unwrap_or(&"".to_string()) + .to_string(), + argv.get_one::("token-file") + .unwrap_or(&"".to_string()) + .to_string(), + argv.get_one::("limit") + .unwrap_or(&"".to_string()) .parse::() .unwrap_or_default(), ); - if argv.is_present("url") { + if !url.is_empty() { search.scan_target(); - } else if argv.is_present("query") { + } else if !query.is_empty() { search.aggregate_search(); } }