From 5d152dbe158cd4ea7b777a8dda83fb7636819ba0 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Tue, 10 Mar 2015 18:56:38 +0100 Subject: [PATCH] Git Column is Useless Without `--long` --- src/options.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/options.rs b/src/options.rs index f23da3d..1feeae4 100644 --- a/src/options.rs +++ b/src/options.rs @@ -279,6 +279,9 @@ impl View { else if matches.opt_present("blocks") { Err(Misfire::Useless("blocks", false, "long")) } + else if cfg!(feature="git") && matches.opt_present("git") { + Err(Misfire::Useless("git", false, "long")) + } else if matches.opt_present("time") { Err(Misfire::Useless("time", false, "long")) } @@ -653,6 +656,13 @@ mod test { assert_eq!(opts.unwrap_err(), Misfire::Useless("blocks", false, "long")) } + #[test] + #[cfg(feature="git")] + fn just_git() { + let opts = Options::getopts(&[ "--git".to_string() ]); + assert_eq!(opts.unwrap_err(), Misfire::Useless("git", false, "long")) + } + #[test] fn extended_without_long() { if xattr::feature_implemented() {