Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.8.2 #41

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/bin/commentective.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 8 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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()),
)),
},
}
}
Expand Down