Skip to content

Commit

Permalink
"--group is useless without --long"
Browse files Browse the repository at this point in the history
  • Loading branch information
killercup committed Mar 10, 2015
1 parent cf38f90 commit a4459da
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,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"))
}
Expand Down Expand Up @@ -629,6 +632,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() ]);
Expand Down

0 comments on commit a4459da

Please sign in to comment.