From a4459da6adbf31dcabfbcb5d165d8d9b42b6949d Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Tue, 10 Mar 2015 19:00:52 +0100 Subject: [PATCH] "`--group` is useless without `--long`" --- src/options.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/options.rs b/src/options.rs index ec015f9..b352c66 100644 --- a/src/options.rs +++ b/src/options.rs @@ -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")) } @@ -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() ]);