mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-12-29 02:53:06 +00:00
parent
ce23c63d75
commit
ea1b3caefa
@ -220,7 +220,7 @@ impl View {
|
|||||||
let details = Details {
|
let details = Details {
|
||||||
columns: try!(Columns::deduce(matches)),
|
columns: try!(Columns::deduce(matches)),
|
||||||
header: matches.opt_present("header"),
|
header: matches.opt_present("header"),
|
||||||
tree: matches.opt_present("recurse"),
|
tree: matches.opt_present("recurse") || matches.opt_present("tree"),
|
||||||
xattr: xattr::feature_implemented() && matches.opt_present("extended"),
|
xattr: xattr::feature_implemented() && matches.opt_present("extended"),
|
||||||
filter: filter,
|
filter: filter,
|
||||||
};
|
};
|
||||||
@ -383,10 +383,10 @@ impl DirAction {
|
|||||||
let tree = matches.opt_present("tree");
|
let tree = matches.opt_present("tree");
|
||||||
|
|
||||||
match (recurse, list, tree) {
|
match (recurse, list, tree) {
|
||||||
(false, _, true ) => Err(Misfire::Useless("tree", false, "recurse")),
|
|
||||||
(true, true, _ ) => Err(Misfire::Conflict("recurse", "list-dirs")),
|
(true, true, _ ) => Err(Misfire::Conflict("recurse", "list-dirs")),
|
||||||
|
(_, true, true ) => Err(Misfire::Conflict("tree", "list-dirs")),
|
||||||
(true, false, false) => Ok(DirAction::Recurse),
|
(true, false, false) => Ok(DirAction::Recurse),
|
||||||
(true, false, true ) => Ok(DirAction::Tree),
|
(_ , _, true ) => Ok(DirAction::Tree),
|
||||||
(false, true, _ ) => Ok(DirAction::AsFile),
|
(false, true, _ ) => Ok(DirAction::AsFile),
|
||||||
(false, false, _ ) => Ok(DirAction::List),
|
(false, false, _ ) => Ok(DirAction::List),
|
||||||
}
|
}
|
||||||
@ -565,11 +565,4 @@ mod test {
|
|||||||
assert_eq!(opts.unwrap_err(), Misfire::Useless("extended", false, "long"))
|
assert_eq!(opts.unwrap_err(), Misfire::Useless("extended", false, "long"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn tree_without_recurse() {
|
|
||||||
let opts = Options::getopts(&[ "--tree".to_string() ]);
|
|
||||||
assert_eq!(opts.unwrap_err(), Misfire::Useless("tree", false, "recurse"))
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user