From fba600daee685b248b1c3dcba81e5eb6fb2bf2c8 Mon Sep 17 00:00:00 2001 From: Gasu16 Date: Wed, 24 Nov 2021 13:44:18 +0100 Subject: [PATCH] done requested changes --- src/app.rs | 2 -- src/flags/display.rs | 12 ++++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/app.rs b/src/app.rs index d7d1a26..326eb69 100644 --- a/src/app.rs +++ b/src/app.rs @@ -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)"), diff --git a/src/flags/display.rs b/src/flags/display.rs index 2305030..f159b8e 100644 --- a/src/flags/display.rs +++ b/src/flags/display.rs @@ -25,16 +25,12 @@ impl Configurable for Display { /// corresponding `Display` variant in a [Some]. If neither of them is passed, this returns /// [None]. fn from_arg_matches(matches: &ArgMatches) -> Option { - if matches.is_present("all") { - if matches.is_present("directory-only") { - Some(Self::DirectoryOnly) - } else { - Some(Self::All) - } + if matches.is_present("directory-only") { + Some(Self::DirectoryOnly) } 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 }