From c946bab08e498bbd5e1b432cf3444d5a351c1c41 Mon Sep 17 00:00:00 2001 From: Stuart Carnie Date: Sun, 28 Feb 2021 07:48:00 +1100 Subject: [PATCH] chore: PR feedback --- README.md | 1 + completions/completions.fish | 1 + man/exa.1.md | 3 +++ src/options/file_name.rs | 7 +------ src/options/help.rs | 2 +- src/output/icons.rs | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b9f546e..9779602 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ exa’s options are almost, but not quite, entirely unlike `ls`’s. - **--colo[u]r**: when to use terminal colours - **--colo[u]r-scale**: highlight levels of file sizes distinctly - **--icons**: display icons +- **--no-icons**: don't display icons (always overrides --icons) ### Filtering options diff --git a/completions/completions.fish b/completions/completions.fish index 4126607..da3f5eb 100755 --- a/completions/completions.fish +++ b/completions/completions.fish @@ -15,6 +15,7 @@ complete -c exa -l 'colour' -d "When to use terminal colours" complete -c exa -l 'color-scale' -d "Highlight levels of file sizes distinctly" complete -c exa -l 'colour-scale' -d "Highlight levels of file sizes distinctly" complete -c exa -l 'icons' -d "Display icons" +complete -c exa -l 'no-icons' -d "Don't display icons" # Filtering and sorting options complete -c exa -l 'group-directories-first' -d "Sort directories before other files" diff --git a/man/exa.1.md b/man/exa.1.md index a0a97de..dd1d55d 100644 --- a/man/exa.1.md +++ b/man/exa.1.md @@ -72,6 +72,9 @@ Valid settings are ‘`always`’, ‘`automatic`’, and ‘`never`’. `--icons` : Display icons next to file names. +`--no-icons` +: Don't display icons. (Always overrides --icons) + FILTERING AND SORTING OPTIONS ============================= diff --git a/src/options/file_name.rs b/src/options/file_name.rs index 568b6b5..96131bb 100644 --- a/src/options/file_name.rs +++ b/src/options/file_name.rs @@ -24,13 +24,8 @@ impl Classify { } impl ShowIcons { - fn enable_icons(matches: &MatchedFlags<'_>) -> bool { - matches.has(&flags::ICONS).unwrap_or_default() - && !matches.has(&flags::NO_ICONS).unwrap_or_default() - } - pub fn deduce(matches: &MatchedFlags<'_>, vars: &V) -> Result { - if ! Self::enable_icons(matches) { + if matches.has(&flags::NO_ICONS)? || !matches.has(&flags::ICONS)? { Ok(Self::Off) } else if let Some(columns) = vars.get(vars::EXA_ICON_SPACING).and_then(|s| s.into_string().ok()) { diff --git a/src/options/help.rs b/src/options/help.rs index 66faa65..cfb944a 100644 --- a/src/options/help.rs +++ b/src/options/help.rs @@ -23,7 +23,7 @@ DISPLAY OPTIONS --colo[u]r=WHEN when to use terminal colours (always, auto, never) --colo[u]r-scale highlight levels of file sizes distinctly --icons display icons - --no-icons hide icons (precedence over --icons) + --no-icons don't display icons (always overrides --icons) FILTERING AND SORTING OPTIONS -a, --all show hidden and 'dot' files diff --git a/src/output/icons.rs b/src/output/icons.rs index b1b5375..2a9373d 100644 --- a/src/output/icons.rs +++ b/src/output/icons.rs @@ -66,7 +66,7 @@ lazy_static! { m.insert("bin", '\u{e5fc}'); //  m.insert("config", '\u{e5fc}'); //  m.insert("docker-compose.yml", '\u{f308}'); //  - m.insert("dockerfile", '\u{f308}'); //  + m.insert("Dockerfile", '\u{f308}'); //  m.insert("ds_store", '\u{f179}'); //  m.insert("gitignore_global", '\u{f1d3}'); //  m.insert("gradle", '\u{e70e}'); // 