diff --git a/Cargo.lock b/Cargo.lock index 644a4c1..25b699e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,9 +67,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "3.1.6" +version = "3.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8c93436c21e4698bacadf42917db28b23017027a4deccb35dbe47a7e7840123" +checksum = "71c47df61d9e16dc010b55dba1952a57d8c215dbb533fd13cdd13369aac73b1c" dependencies = [ "bitflags", "indexmap", @@ -119,9 +119,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" +checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" dependencies = [ "cfg-if", "crossbeam-utils", @@ -140,10 +140,11 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.7" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c00d6d2ea26e8b151d99093005cb442fb9a37aeaca582a03ec70946f49ab5ed9" +checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c" dependencies = [ + "autocfg", "cfg-if", "crossbeam-utils", "lazy_static", @@ -153,9 +154,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e5bed1f1c269533fa816a0a5492b3545209a205ca1a54842be180eb63a16a6" +checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" dependencies = [ "cfg-if", "lazy_static", @@ -220,9 +221,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" +checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" dependencies = [ "autocfg", "hashbrown", @@ -254,9 +255,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.119" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4" +checksum = "ec647867e2bf0772e28c8bcde4f0d19a9216916e890543b5a03ed8ef27b8f259" [[package]] name = "memchr" @@ -370,9 +371,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.11" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8380fe0152551244f0747b1bf41737e0f8a74f97a14ccefd1148187271634f3c" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" dependencies = [ "bitflags", ] diff --git a/Cargo.toml b/Cargo.toml index d02d9ad..6640746 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ codecov = { repository = "simeg/commentective", branch = "master", service = "gi dumb_terminal = ["colored/no-color"] [dependencies] -clap = { version = "3.1.6", default-features = false, features = ["std", "cargo"] } +clap = { version = "3.1.8", default-features = false, features = ["std", "cargo"] } colored = "2.0.0" console = "0.15.0" rayon = "1.5.1" diff --git a/src/bin/commentective.rs b/src/bin/commentective.rs index 8904375..52ac3b9 100644 --- a/src/bin/commentective.rs +++ b/src/bin/commentective.rs @@ -54,7 +54,7 @@ fn main() { let matches = Command::new("commentective") .author(crate_authors!()) .version(crate_version!()) - .override_help("CLI tool to find comments and commented out code") + .about("CLI tool to find comments and commented out code") .arg(arg_files) .arg(arg_ignore_empty) .arg(arg_short) diff --git a/src/lib.rs b/src/lib.rs index f777d3b..4f13eb5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -79,13 +79,11 @@ where path.extension().and_then(OsStr::to_str) }; - let err_unsupported = Err(Error::new( - ErrorKind::NotFound, - format!("Unsupported file extension for path: {}", path.display()), - )); - match extension_file { - None => err_unsupported, + None => Err(Error::new( + ErrorKind::NotFound, + format!("Could not identify extension for file: {}", path.display()), + )), Some(extension) => match extension { "c" => C::with_finder(self.finder).find(path), "cpp" => Cpp::with_finder(self.finder).find(path), @@ -102,7 +100,10 @@ where "rs" => Rust::with_finder(self.finder).find(path), "scala" => Scala::with_finder(self.finder).find(path), "sh" => Bash::with_finder(self.finder).find(path), - _ => err_unsupported, + _ => Err(Error::new( + ErrorKind::NotFound, + format!("Unsupported file extension for path: {}", path.display()), + )), }, } }