diff --git a/docs/images/help.png b/docs/images/help.png index 263d5a8..8975026 100644 Binary files a/docs/images/help.png and b/docs/images/help.png differ diff --git a/src/bin/git-view.rs b/src/bin/git-view.rs index 1c8cf53..0997052 100644 --- a/src/bin/git-view.rs +++ b/src/bin/git-view.rs @@ -1,6 +1,6 @@ use std::panic::set_hook; -use clap::{command, crate_authors, crate_description, crate_version, Arg, Command, ErrorKind}; +use clap::{command, crate_authors, crate_version, Arg, Command, ErrorKind}; use git_view::Git; use git_view::GitView; @@ -44,11 +44,11 @@ This currently supports the following URLs: ) .arg( Arg::new("commit") - .long_help("The commit to view git repository on\n[default: latest]") + .long_help("The commit to view git repository on\n[default: current commit]") .short('c') .long("commit") .value_name("hash") - .default_missing_value("latest") + .default_missing_value("current") .conflicts_with_all(&["remote", "branch"]) .display_order(3), ) diff --git a/src/lib.rs b/src/lib.rs index 0ecdc92..3a99247 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -225,7 +225,7 @@ impl<'a> GitView<'a> { // Handle commit flag if let Some(commit) = self.commit { - if commit == "latest" { + if commit == "current" { let commit_hash = match git.get_current_commit()? { GitOutput::Ok(hash) => Ok(hash), GitOutput::Err(err) => Err(AppError::new(ErrorType::CommandFailed, err)), @@ -770,7 +770,7 @@ mod lib_tests { #[test] fn is_latest_commit() { - let handler = GitView::builder().with_commit("latest").build(); + let handler = GitView::builder().with_commit("current").build(); let url = Url::new("https", Domain::GitHub, "sgoudham/git-view"); let expected_final_url = "https://github.com/sgoudham/git-view/tree/commit_hash"; let mut mock = MockGitTrait::default();