Merge pull request #49 from killercup/feature/group-is-useless-without-long

Add "`--group` is useless without `--long`"
This commit is contained in:
Ben S 2015-03-11 14:56:34 +00:00
commit 860e19d292

View File

@ -288,6 +288,9 @@ impl View {
else if matches.opt_present("tree") {
Err(Misfire::Useless("tree", false, "long"))
}
else if matches.opt_present("group") {
Err(Misfire::Useless("group", false, "long"))
}
else if matches.opt_present("level") && !matches.opt_present("recurse") {
Err(Misfire::Useless2("level", "recurse", "tree"))
}
@ -638,6 +641,12 @@ mod test {
assert_eq!(opts.unwrap_err(), Misfire::Useless("header", false, "long"))
}
#[test]
fn just_group() {
let opts = Options::getopts(&[ "--group".to_string() ]);
assert_eq!(opts.unwrap_err(), Misfire::Useless("group", false, "long"))
}
#[test]
fn just_inode() {
let opts = Options::getopts(&[ "--inode".to_string() ]);