Ver código fonte

chore: PR feedback

Stuart Carnie 5 anos atrás
pai
commit
c946bab08e

+ 1 - 0
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
 

+ 1 - 0
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"

+ 3 - 0
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
 =============================

+ 1 - 6
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<V: Vars>(matches: &MatchedFlags<'_>, vars: &V) -> Result<Self, OptionsError> {
-        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()) {

+ 1 - 1
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

+ 1 - 1
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}'); // 