done requested changes

This commit is contained in:
Gasu16 2021-11-24 13:44:18 +01:00 committed by Wei Zhang
parent 3a28c71cfe
commit fba600daee
2 changed files with 4 additions and 10 deletions

View file

@ -120,8 +120,6 @@ pub fn build() -> App<'static, 'static> {
Arg::with_name("directory-only")
.short("d")
.long("directory-only")
//.conflicts_with("all")
//.conflicts_with("almost-all")
.conflicts_with("depth")
.conflicts_with("recursive")
.help("Display directories themselves, and not their contents (recursively when used with --tree)"),

View file

@ -25,16 +25,12 @@ impl Configurable<Self> for Display {
/// corresponding `Display` variant in a [Some]. If neither of them is passed, this returns
/// [None].
fn from_arg_matches(matches: &ArgMatches) -> Option<Self> {
if matches.is_present("all") {
if matches.is_present("directory-only") {
Some(Self::DirectoryOnly)
} else {
Some(Self::All)
}
} else if matches.is_present("almost-all") {
Some(Self::AlmostAll)
} else if matches.is_present("directory-only") {
Some(Self::DirectoryOnly)
} else if matches.is_present("all") {
Some(Self::All)
} else {
None
}