Git Column is Useless Without --long

This commit is contained in:
Pascal Hertleif 2015-03-10 18:56:38 +01:00
parent 7dc3a02185
commit 5d152dbe15

View File

@ -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() {