Explorar el Código

Merge branch 'main' into missing_styles

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Christina Sørensen hace 2 años
padre
commit
6ee896f96d

+ 5 - 0
.github/workflows/apt.yml

@@ -12,6 +12,11 @@ on:
     paths:
       - 'deb.asc'
       - '.github/workflows/apt.yml'
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
+  cancel-in-progress: true
+
 jobs:
   apt_installation:
     runs-on: ubuntu-latest

+ 5 - 4
.github/workflows/conventional-commits.yml

@@ -6,14 +6,15 @@ on:
   pull_request:
     branches: [ main ]
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
+  cancel-in-progress: true
+
 jobs:
   build:
     name: Conventional Commits
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v4
 
       - uses: webiny/action-conventional-commits@v1.1.0
-        # optional, required for private repos
-        # with:
-        #   GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

+ 4 - 0
.github/workflows/flake.yml

@@ -3,6 +3,10 @@ on:
   push:
     branches: [main]
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
+  cancel-in-progress: true
+
 jobs:
   build:
     name: Build Nix targets

+ 0 - 2
.github/workflows/label.yml

@@ -20,5 +20,3 @@ jobs:
 
     steps:
     - uses: actions/labeler@v4
-      with:
-        repo-token: "${{ secrets.GITHUB_TOKEN }}"

+ 0 - 2
.github/workflows/stale.yml

@@ -20,8 +20,6 @@ jobs:
     steps:
     - uses: actions/stale@v8
       with:
-        repo-token: ${{ secrets.GITHUB_TOKEN }}
-        
         days-before-pr-stale: 30
         days-before-pr-close: 14
         stale-pr-message: 'This pull request is stale because it has been open for 30 days with no activity.'

+ 6 - 4
.github/workflows/unit-tests.yml

@@ -16,6 +16,10 @@ on:
       - 'Cargo.*'
       - build.rs
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
+  cancel-in-progress: true
+
 env:
   CARGO_TERM_COLOR: always
 
@@ -34,10 +38,8 @@ jobs:
       - name: Checkout repository
         uses: actions/checkout@v4
 
-      - name: Install Rust toolchain
-        uses: dtolnay/rust-toolchain@v1
-        with:
-          toolchain: ${{ matrix.rust }}
+      - run: rustup toolchain install ${{ matrix.rust }} --profile minimal
+      - uses: Swatinem/rust-cache@v2
 
       - name: Install cargo-hack
         uses: nick-fields/retry@v2

+ 6 - 6
Cargo.lock

@@ -142,9 +142,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
 
 [[package]]
 name = "chrono"
-version = "0.4.30"
+version = "0.4.31"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877"
+checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38"
 dependencies = [
  "android-tzdata",
  "iana-time-zone",
@@ -583,9 +583,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
 
 [[package]]
 name = "libc"
-version = "0.2.147"
+version = "0.2.148"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3"
+checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b"
 
 [[package]]
 name = "libgit2-sys"
@@ -1149,9 +1149,9 @@ dependencies = [
 
 [[package]]
 name = "timeago"
-version = "0.4.1"
+version = "0.4.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5082dc942361cdfb74eab98bf995762d6015e5bb3a20bf7c5c71213778b4fcb4"
+checksum = "a1710e589de0a76aaf295cd47a6699f6405737dbfd3cf2b75c92d000b548d0e6"
 
 [[package]]
 name = "tinytemplate"

+ 47 - 13
Cargo.toml

@@ -5,7 +5,13 @@ authors = ["Christina Sørensen <christina@cafkafk.com>"]
 categories = ["command-line-utilities"]
 edition = "2021"
 rust-version = "1.70.0"
-exclude = ["/devtools/*", "/Justfile", "/Vagrantfile", "/screenshots.png", "/tests"]
+exclude = [
+  "/devtools/*",
+  "/Justfile",
+  "/Vagrantfile",
+  "/screenshots.png",
+  "/tests",
+]
 readme = "README.md"
 homepage = "https://github.com/eza-community/eza"
 license = "MIT"
@@ -14,7 +20,7 @@ version = "0.13.0"
 
 
 [package.metadata.deb]
-license-file = [ "LICENCE", "4" ]
+license-file = ["LICENCE", "4"]
 depends = "$auto"
 extended-description = """
 eza is a modern, maintained replacement for ls
@@ -22,13 +28,41 @@ eza is a modern, maintained replacement for ls
 section = "utils"
 priority = "optional"
 assets = [
-    [ "target/release/eza", "/usr/bin/eza", "0755" ],
-    [ "target/release/../man/eza.1", "/usr/share/man/man1/eza.1", "0644" ],
-    [ "target/release/../man/eza_colors.5", "/usr/share/man/man5/eza_colors.5", "0644" ],
-    [ "target/release/../man/eza_colors-explanation.5", "/usr/share/man/man5/eza_colors-explanation.5", "0644" ],
-    [ "completions/bash/eza", "/usr/share/bash-completion/completions/eza", "0644" ],
-    [ "completions/zsh/_eza", "/usr/share/zsh/site-functions/_eza", "0644" ],
-    [ "completions/fish/eza.fish", "/usr/share/fish/vendor_completions.d/eza.fish", "0644" ],
+  [
+    "target/release/eza",
+    "/usr/bin/eza",
+    "0755",
+  ],
+  [
+    "target/release/../man/eza.1",
+    "/usr/share/man/man1/eza.1",
+    "0644",
+  ],
+  [
+    "target/release/../man/eza_colors.5",
+    "/usr/share/man/man5/eza_colors.5",
+    "0644",
+  ],
+  [
+    "target/release/../man/eza_colors-explanation.5",
+    "/usr/share/man/man5/eza_colors-explanation.5",
+    "0644",
+  ],
+  [
+    "completions/bash/eza",
+    "/usr/share/bash-completion/completions/eza",
+    "0644",
+  ],
+  [
+    "completions/zsh/_eza",
+    "/usr/share/zsh/site-functions/_eza",
+    "0644",
+  ],
+  [
+    "completions/fish/eza.fish",
+    "/usr/share/fish/vendor_completions.d/eza.fish",
+    "0644",
+  ],
 ]
 
 
@@ -39,7 +73,7 @@ name = "eza"
 [dependencies]
 ansiterm = "0.12.2"
 gethostname = "0.4.3"
-chrono = { version = "0.4.30", default-features = false, features = ["clock"] }
+chrono = { version = "0.4.31", default-features = false, features = ["clock"] }
 glob = "0.3"
 lazy_static = "1.3"
 libc = "0.2"
@@ -48,11 +82,11 @@ log = "0.4"
 natord = "1.0"
 num_cpus = "1.16"
 number_prefix = "0.4"
-phf = { version = "0.11.2", features = ["macros"]}
+phf = { version = "0.11.2", features = ["macros"] }
 scoped_threadpool = "0.1"
 term_grid = "0.1"
 terminal_size = "0.2.6"
-timeago = { version = "0.4.1", default-features = false }
+timeago = { version = "0.4.2", default-features = false }
 unicode-width = "0.1"
 urlencoding = "2.1.3"
 zoneinfo_compiled = "0.5.1"
@@ -69,7 +103,7 @@ proc-mounts = "0.3"
 uzers = "0.11.3"
 
 [build-dependencies]
-chrono = { version = "0.4.30", default-features = false, features = ["clock"] }
+chrono = { version = "0.4.31", default-features = false, features = ["clock"] }
 
 [dev-dependencies]
 criterion = { version = "0.5.1", features = ["html_reports"] }

+ 3 - 1
README.md

@@ -302,7 +302,7 @@ These options are available when running with `--long` (`-l`):
 - **-H**, **--links**: list each file’s number of hard links
 - **-i**, **--inode**: list each file’s inode number
 - **-m**, **--modified**: use the modified timestamp field
-- **-M**, **--mounts**: Show mount details (Linux only).
+- **-M**, **--mounts**: Show mount details (Linux and MacOS only).
 - **-S**, **--blocksize**: show size of allocated file system blocks
 - **-t**, **--time=(field)**: which timestamp field to use
 - **-u**, **--accessed**: use the accessed timestamp field
@@ -312,6 +312,8 @@ These options are available when running with `--long` (`-l`):
 - **-@**, **--extended**: list each file’s extended attributes and sizes
 - **--changed**: use the changed timestamp field
 - **--git**: list each file’s Git status, if tracked or ignored
+- **--git-repos**: list each directory’s Git status, if tracked
+- **--git-repos-no-status**:  list whether a directory is a Git repository, but not its status (faster)
 - **--no-git**: suppress Git status (always overrides `--git`, `--git-repos`, `--git-repos-no-status`)
 - **--time-style**: how to format timestamps
 - **--no-permissions**: suppress the permissions field

+ 1 - 1
benches/my_benchmark.rs

@@ -1,7 +1,7 @@
 use criterion::{black_box, criterion_group, criterion_main, Criterion};
 
 pub fn criterion_benchmark(c: &mut Criterion) {
-    c.bench_function("logger", |b| b.iter(|| eza::logger::configure(black_box(std::env::var_os(eza::options::vars::EXA_DEBUG)))));
+    c.bench_function("logger", |b| b.iter(|| eza::logger::configure(black_box(std::env::var_os(eza::options::vars::EZA_DEBUG)))));
 }
 
 criterion_group!(benches, criterion_benchmark);

+ 29 - 29
deny.toml

@@ -20,13 +20,13 @@
 # dependencies not shared by any other crates, would be ignored, as the target
 # list here is effectively saying which targets you are building for.
 targets = [
-    # The triple can be any string, but only the target triples built in to
-    # rustc (as of 1.40) can be checked against actual config expressions
-    #{ triple = "x86_64-unknown-linux-musl" },
-    # You can also specify which target_features you promise are enabled for a
-    # particular target. target_features are currently not validated against
-    # the actual valid features supported by the target architecture.
-    #{ triple = "wasm32-unknown-unknown", features = ["atomics"] },
+  # The triple can be any string, but only the target triples built in to
+  # rustc (as of 1.40) can be checked against actual config expressions
+  #{ triple = "x86_64-unknown-linux-musl" },
+  # You can also specify which target_features you promise are enabled for a
+  # particular target. target_features are currently not validated against
+  # the actual valid features supported by the target architecture.
+  #{ triple = "wasm32-unknown-unknown", features = ["atomics"] },
 ]
 # When creating the dependency graph used as the source of truth when checks are
 # executed, this field can be used to prune crates from the graph, removing them
@@ -74,7 +74,7 @@ notice = "warn"
 # A list of advisory IDs to ignore. Note that ignored advisories will still
 # output a note when they are encountered.
 ignore = [
-    #"RUSTSEC-0000-0000",
+  #"RUSTSEC-0000-0000",
 ]
 # Threshold for security vulnerabilities, any vulnerability with a CVSS score
 # lower than the range specified will be ignored. Note that ignored advisories
@@ -102,16 +102,16 @@ unlicensed = "deny"
 # See https://spdx.org/licenses/ for list of possible licenses
 # [possible values: any SPDX 3.11 short identifier (+ optional exception)].
 allow = [
-    "MIT",
-    "Unicode-DFS-2016",
-    "Apache-2.0",
-    #"Apache-2.0 WITH LLVM-exception",
+  "MIT",
+  "Unicode-DFS-2016",
+  "Apache-2.0",
+  #"Apache-2.0 WITH LLVM-exception",
 ]
 # List of explicitly disallowed licenses
 # See https://spdx.org/licenses/ for list of possible licenses
 # [possible values: any SPDX 3.11 short identifier (+ optional exception)].
 deny = [
-    #"Nokia",
+  #"Nokia",
 ]
 # Lint level for licenses considered copyleft
 copyleft = "warn"
@@ -137,9 +137,9 @@ confidence-threshold = 0.8
 # Allow 1 or more licenses on a per-crate basis, so that particular licenses
 # aren't accepted for every possible crate as with the normal allow list
 exceptions = [
-    # Each entry is the crate and version constraint, and its specific allow
-    # list
-    #{ allow = ["Zlib"], name = "adler32", version = "*" },
+  # Each entry is the crate and version constraint, and its specific allow
+  # list
+  #{ allow = ["Zlib"], name = "adler32", version = "*" },
 ]
 
 # Some crates don't have (easily) machine readable licensing information,
@@ -158,8 +158,8 @@ exceptions = [
 # and the crate will be checked normally, which may produce warnings or errors
 # depending on the rest of your configuration
 #license-files = [
-    # Each entry is a crate relative path, and the (opaque) hash of its contents
-    #{ path = "LICENSE", hash = 0xbd0eed23 }
+# Each entry is a crate relative path, and the (opaque) hash of its contents
+#{ path = "LICENSE", hash = 0xbd0eed23 }
 #]
 
 [licenses.private]
@@ -172,7 +172,7 @@ ignore = false
 # is only published to private registries, and ignore is true, the crate will
 # not have its license(s) checked
 registries = [
-    #"https://sekretz.com/registry
+  #"https://sekretz.com/registry
 ]
 
 # This section is considered when running `cargo deny check bans`.
@@ -199,17 +199,17 @@ workspace-default-features = "allow"
 external-default-features = "allow"
 # List of crates that are allowed. Use with care!
 allow = [
-    #{ name = "ansi_term", version = "=0.11.0" },
+  #{ name = "ansi_term", version = "=0.11.0" },
 ]
 # List of crates to deny
 deny = [
-    # Each entry the name of a crate and a version range. If version is
-    # not specified, all versions will be matched.
-    #{ name = "ansi_term", version = "=0.11.0" },
-    #
-    # Wrapper crates can optionally be specified to allow the crate when it
-    # is a direct dependency of the otherwise banned crate
-    #{ name = "ansi_term", version = "=0.11.0", wrappers = [] },
+  # Each entry the name of a crate and a version range. If version is
+  # not specified, all versions will be matched.
+  #{ name = "ansi_term", version = "=0.11.0" },
+  #
+  # Wrapper crates can optionally be specified to allow the crate when it
+  # is a direct dependency of the otherwise banned crate
+  #{ name = "ansi_term", version = "=0.11.0", wrappers = [] },
 ]
 
 # List of features to allow/deny
@@ -237,14 +237,14 @@ deny = [
 
 # Certain crates/versions that will be skipped when doing duplicate detection.
 skip = [
-    #{ name = "ansi_term", version = "=0.11.0" },
+  #{ name = "ansi_term", version = "=0.11.0" },
 ]
 # Similarly to `skip` allows you to skip certain crates during duplicate
 # detection. Unlike skip, it also includes the entire tree of transitive
 # dependencies starting at the specified crate, up to a certain depth, which is
 # by default infinite.
 skip-tree = [
-    #{ name = "ansi_term", version = "=0.11.0", depth = 20 },
+  #{ name = "ansi_term", version = "=0.11.0", depth = 20 },
 ]
 
 # This section is considered when running `cargo deny check sources`.

+ 7 - 5
man/eza.1.md

@@ -197,7 +197,7 @@ These options are available when running with `--long` (`-l`):
 
 `--git`  [if eza was built with git support]
 : List each file’s Git status, if tracked.
-This adds a two-character column indicating the staged and unstaged statuses respectively. The status character can be ‘`-`’ for not modified, ‘`M`’ for a modified file, ‘`N`’ for a new file, ‘`D`’ for deleted, ‘`R`’ for renamed, ‘`T`’ for type-change, ‘`I`’ for ignored, and ‘`U`’ for conflicted. :Directories will be shown to have the status of their contents, which is how ‘deleted’ is possible if a directory contains a file that has a certain status, it will be shown to have that status.  
+This adds a two-character column indicating the staged and unstaged statuses respectively. The status character can be ‘`-`’ for not modified, ‘`M`’ for a modified file, ‘`N`’ for a new file, ‘`D`’ for deleted, ‘`R`’ for renamed, ‘`T`’ for type-change, ‘`I`’ for ignored, and ‘`U`’ for conflicted. Directories will be shown to have the status of their contents, which is how ‘deleted’ is possible if a directory contains a file that has a certain status, it will be shown to have that status.  
 
 `--git-repos` [if eza was built with git support]
 : List each directory’s Git status, if tracked.
@@ -215,6 +215,8 @@ All Git repository directories will be shown as (themed) `-` without status indi
 ENVIRONMENT VARIABLES
 =====================
 
+If an environment variable prefixed with `EZA_` is not set, for backward compatibility, it will default to its counterpart starting with `EXA_`.
+
 eza responds to the following environment variables:
 
 ## `COLUMNS`
@@ -225,7 +227,7 @@ For example, ‘`COLUMNS=80 eza`’ will show a grid view with a maximum width o
 
 This option won’t do anything when eza’s output doesn’t wrap, such as when using the `--long` view.
 
-## `EXA_STRICT`
+## `EZA_STRICT`
 
 Enables _strict mode_, which will make eza error when two command-line options are incompatible.
 
@@ -235,14 +237,14 @@ In strict mode, the two options will not co-operate, and eza will error.
 
 This option is intended for use with automated scripts and other situations where you want to be certain you’re typing in the right command.
 
-## `EXA_GRID_ROWS`
+## `EZA_GRID_ROWS`
 
 Limits the grid-details view (‘`eza --grid --long`’) so it’s only activated when at least the given number of rows of output would be generated.
 
 With widescreen displays, it’s possible for the grid to look very wide and sparse, on just one or two lines with none of the columns lining up.
 By specifying a minimum number of rows, you can only use the view if it’s going to be worth using.
 
-## `EXA_ICON_SPACING`
+## `EZA_ICON_SPACING`
 
 Specifies the number of spaces to print between an icon (see the ‘`--icons`’ option) and its file name.
 
@@ -254,7 +256,7 @@ Disables colours in the output (regardless of its value). Can be overridden by `
 
 See `https://no-color.org/` for details.
 
-## `LS_COLORS`, `EXA_COLORS`
+## `LS_COLORS`, `EZA_COLORS`
 
 Specifies the colour scheme used to highlight files based on their name and kind, as well as highlighting metadata and parts of the UI.
 

+ 9 - 9
man/eza_colors-explanation.5.md

@@ -8,22 +8,22 @@ eza provides its own built\-in set of file extension mappings that cover a large
 Any mappings in the environment variables will override this default set: running eza with `LS_COLORS="*.zip=32"` will turn zip files green but leave the colours of other compressed files alone.
 
 You can also disable this built\-in set entirely by including a
-`reset` entry at the beginning of `EXA_COLORS`.
-So setting `EXA_COLORS="reset:*.txt=31"` will highlight only text
-files; setting `EXA_COLORS="reset"` will highlight nothing.
+`reset` entry at the beginning of `EZA_COLORS`.
+So setting `EZA_COLORS="reset:*.txt=31"` will highlight only text
+files; setting `EZA_COLORS="reset"` will highlight nothing.
 
 ## Examples
 
-- Disable the "current user" highlighting: `EXA_COLORS="uu=0:gu=0"`
-- Turn the date column green: `EXA_COLORS="da=32"`
-- Highlight Vagrantfiles: `EXA_COLORS="Vagrantfile=1;4;33"`
-- Override the existing zip colour: `EXA_COLORS="*.zip=38;5;125"`
+- Disable the "current user" highlighting: `EZA_COLORS="uu=0:gu=0"`
+- Turn the date column green: `EZA_COLORS="da=32"`
+- Highlight Vagrantfiles: `EZA_COLORS="Vagrantfile=1;4;33"`
+- Override the existing zip colour: `EZA_COLORS="*.zip=38;5;125"`
 - Markdown files a shade of green, log files a shade of grey:
-`EXA_COLORS="*.md=38;5;121:*.log=38;5;248"`
+`EZA_COLORS="*.md=38;5;121:*.log=38;5;248"`
 
 ## BUILT\-IN EXTENSIONS
 
-- eza now supports bright colours! As supported by most modern 256\-colour terminals, you can now choose from `bright` colour codes when selecting your custom colours in your `#EXA_COLORS` environment variable.
+- eza now supports bright colours! As supported by most modern 256\-colour terminals, you can now choose from `bright` colour codes when selecting your custom colours in your `#EZA_COLORS` environment variable.
 
 - Build (Makefile, Cargo.toml, package.json) are yellow and underlined.
 - Images (png, jpeg, gif) are purple.

+ 12 - 10
man/eza_colors.5.md

@@ -14,7 +14,7 @@ eza_colors — customising the file and UI colours of eza
 SYNOPSIS
 ========
 
-The `EXA_COLORS` environment variable can be used to customise the colours that `eza` uses to highlight file names, file metadata, and parts of the UI.
+The `EZA_COLORS` environment variable can be used to customise the colours that `eza` uses to highlight file names, file metadata, and parts of the UI.
 
 You can use the `dircolors` program to generate a script that sets the variable from an input file, or if you don’t mind editing long strings of text, you can just type it out directly. These variables have the following structure:
 
@@ -24,23 +24,25 @@ You can use the `dircolors` program to generate a script that sets the variable
 
 The key half of the pair can either be a two-letter code or a file glob, and anything that’s not a valid code will be treated as a glob, including keys that happen to be two letters long.
 
+For backwards compatability `EXA_COLORS` environment variables is checked if `EZA_COLORS` is unset.
+
 
 EXAMPLES
 ========
 
-`EXA_COLORS="uu=0:gu=0"`
+`EZA_COLORS="uu=0:gu=0"`
 : Disable the “current user” highlighting
 
-`EXA_COLORS="da=32"`
+`EZA_COLORS="da=32"`
 : Turn the date column green
 
-`EXA_COLORS="Vagrantfile=1;4;33"`
+`EZA_COLORS="Vagrantfile=1;4;33"`
 : Highlight Vagrantfiles
 
-`EXA_COLORS="*.zip=38;5;125"`
+`EZA_COLORS="*.zip=38;5;125"`
 : Override the existing zip colour
 
-`EXA_COLORS="*.md=38;5;121:*.log=38;5;248"`
+`EZA_COLORS="*.md=38;5;121:*.log=38;5;248"`
 : Markdown files a shade of green, log files a shade of grey
 
 
@@ -77,7 +79,7 @@ LIST OF CODES
 : symlinks with no target
 
 
-`EXA_COLORS` can use many more:
+`EZA_COLORS` can use many more:
 
 `oc`
 : the permissions displayed as octal
@@ -251,7 +253,7 @@ LIST OF CODES
 : a regular file that is a document (ex: office suite document or PDF)
 
 `co`
-: a regular file this is compressed
+: a regular file that is compressed
 
 `tm`
 : a regular file that is temporary (ex: a text editor's backup file)
@@ -352,8 +354,8 @@ Many terminals will treat bolded text as a different colour, or at least provide
 eza provides its own built-in set of file extension mappings that cover a large range of common file extensions, including documents, archives, media, and temporary files.
 Any mappings in the environment variables will override this default set: running eza with `LS_COLORS="*.zip=32"` will turn zip files green but leave the colours of other compressed files alone.
 
-You can also disable this built-in set entirely by including a `reset` entry at the beginning of `EXA_COLORS`.
-So setting `EXA_COLORS="reset:*.txt=31"` will highlight only text files; setting `EXA_COLORS="reset"` will highlight nothing.
+You can also disable this built-in set entirely by including a `reset` entry at the beginning of `EZA_COLORS`.
+So setting `EZA_COLORS="reset:*.txt=31"` will highlight only text files; setting `EZA_COLORS="reset"` will highlight nothing.
 
 
 AUTHOR

+ 8 - 1
rust-toolchain.toml

@@ -1,4 +1,11 @@
 [toolchain]
 channel = "1.70"
-components = [ "rustfmt", "rustc", "rust-src", "rust-analyzer", "cargo", "clippy" ]
+components = [
+  "rustfmt",
+  "rustc",
+  "rust-src",
+  "rust-analyzer",
+  "cargo",
+  "clippy",
+]
 profile = "minimal"

+ 0 - 3
snap/snapcraft.yaml

@@ -7,14 +7,11 @@ description: |
   group. It also has extra features not present in the original ls, such as
   viewing the Git status for a directory, or recursing into directories with a
   tree view. eza is written in Rust, and it’s small, fast, and portable.
-
 grade: stable
 confinement: classic
-
 apps:
   eza:
     command: eza
-
 parts:
   eza:
     plugin: rust

+ 1 - 1
src/main.rs

@@ -52,7 +52,7 @@ fn main() {
         libc::signal(libc::SIGPIPE, libc::SIG_DFL);
     }
 
-    logger::configure(env::var_os(vars::EXA_DEBUG));
+    logger::configure(env::var_os(vars::EZA_DEBUG).or_else(|| env::var_os(vars::EXA_DEBUG)));
 
     #[cfg(windows)]
     if let Err(e) = ansiterm::enable_ansi_support() {

+ 2 - 2
src/options/file_name.rs

@@ -29,13 +29,13 @@ impl ShowIcons {
         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()) {
+        else if let Some(columns) = vars.get_with_fallback(vars::EZA_ICON_SPACING, vars::EXA_ICON_SPACING).and_then(|s| s.into_string().ok()) {
             match columns.parse() {
                 Ok(width) => {
                     Ok(Self::On(width))
                 }
                 Err(e) => {
-                    let source = NumberSource::Env(vars::EXA_ICON_SPACING);
+                    let source = NumberSource::Env(vars.source(vars::EZA_ICON_SPACING, vars::EXA_ICON_SPACING).unwrap());
                     Err(OptionsError::FailedParse(columns, source, e))
                 }
             }

+ 1 - 1
src/options/mod.rs

@@ -133,7 +133,7 @@ impl Options {
     {
         use crate::options::parser::{Matches, Strictness};
 
-        let strictness = match vars.get(vars::EXA_STRICT) {
+        let strictness = match vars.get_with_fallback(vars::EZA_STRICT, vars::EXA_STRICT) {
             None                         => Strictness::UseLastArguments,
             Some(ref t) if t.is_empty()  => Strictness::UseLastArguments,
             Some(_)                      => Strictness::ComplainAboutRedundantArguments,

+ 5 - 3
src/options/theme.rs

@@ -59,8 +59,10 @@ impl ColourScale {
 
 impl Definitions {
     fn deduce<V: Vars>(vars: &V) -> Self {
-        let ls =  vars.get(vars::LS_COLORS) .map(|e| e.to_string_lossy().to_string());
-        let exa = vars.get(vars::EXA_COLORS).map(|e| e.to_string_lossy().to_string());
+        let ls =  vars.get(vars::LS_COLORS)
+            .map(|e| e.to_string_lossy().to_string());
+        let exa = vars.get_with_fallback(vars::EZA_COLORS, vars::EXA_COLORS)
+            .map(|e| e.to_string_lossy().to_string());
         Self { ls, exa }
     }
 }
@@ -148,7 +150,7 @@ mod terminal_test {
             if name == vars::LS_COLORS && ! self.ls.is_empty() {
                 Some(OsString::from(self.ls))
             }
-            else if name == vars::EXA_COLORS && ! self.exa.is_empty() {
+            else if (name == vars::EZA_COLORS || name == vars::EXA_COLORS) && ! self.exa.is_empty() {
                 Some(OsString::from(self.exa))
             }
             else if name == vars::NO_COLOR && ! self.no_color.is_empty() {

+ 20 - 0
src/options/vars.rs

@@ -25,6 +25,7 @@ pub static NO_COLOR: &str = "NO_COLOR";
 /// enabled. This includes all the colours that `LS_COLORS` would recognise,
 /// overriding them if necessary. It can also contain exa-specific codes.
 pub static EXA_COLORS: &str = "EXA_COLORS";
+pub static EZA_COLORS: &str = "EZA_COLORS";
 
 /// Environment variable used to switch on strict argument checking, such as
 /// complaining if an argument was specified twice, or if two conflict.
@@ -32,26 +33,45 @@ pub static EXA_COLORS: &str = "EXA_COLORS";
 /// behaviour in a script, rather than for general command-line use.
 /// Any non-empty value will turn strict mode on.
 pub static EXA_STRICT: &str = "EXA_STRICT";
+pub static EZA_STRICT: &str = "EZA_STRICT";
 
 /// Environment variable used to make exa print out debugging information as
 /// it runs. Any non-empty value will turn debug mode on.
 pub static EXA_DEBUG: &str = "EXA_DEBUG";
+pub static EZA_DEBUG: &str = "EZA_DEBUG";
 
 /// Environment variable used to limit the grid-details view
 /// (`--grid --long`) so it’s only activated if there’s at least the given
 /// number of rows of output.
 pub static EXA_GRID_ROWS: &str = "EXA_GRID_ROWS";
+pub static EZA_GRID_ROWS: &str = "EZA_GRID_ROWS";
 
 /// Environment variable used to specify how many spaces to print between an
 /// icon and its file name. Different terminals display icons differently,
 /// with 1 space bringing them too close together or 2 spaces putting them too
 /// far apart, so this may be necessary depending on how they are shown.
 pub static EXA_ICON_SPACING: &str = "EXA_ICON_SPACING";
+pub static EZA_ICON_SPACING: &str = "EZA_ICON_SPACING";
 
 
 /// Mockable wrapper for `std::env::var_os`.
 pub trait Vars {
     fn get(&self, name: &'static str) -> Option<OsString>;
+
+    /// Get the variable `name` and if not set get the variable `fallback`.
+    fn get_with_fallback(&self, name: &'static str, fallback: &'static str) -> Option<OsString> {
+        self.get(name).or_else(|| self.get(fallback))
+    }
+
+    /// Get the source of the value.  If the variable `name` is set return
+    /// `Some(name)` else if the variable `fallback` is set return
+    /// `Some(fallback)` else `None`.
+    fn source(&self, name: &'static str, fallback: &'static str) -> Option<&'static str> {
+        match self.get(name) {
+            Some(_) => Some(name),
+            None    => self.get(fallback).and(Some(fallback)),
+        }
+    }
 }
 
 

+ 2 - 2
src/options/view.rs

@@ -189,13 +189,13 @@ impl RowThreshold {
     fn deduce<V: Vars>(vars: &V) -> Result<Self, OptionsError> {
         use crate::options::vars;
 
-        if let Some(columns) = vars.get(vars::EXA_GRID_ROWS).and_then(|s| s.into_string().ok()) {
+        if let Some(columns) = vars.get_with_fallback(vars::EZA_GRID_ROWS, vars::EXA_GRID_ROWS).and_then(|s| s.into_string().ok()) {
             match columns.parse() {
                 Ok(rows) => {
                     Ok(Self::MinimumRows(rows))
                 }
                 Err(e) => {
-                    let source = NumberSource::Env(vars::EXA_GRID_ROWS);
+                    let source = NumberSource::Env(vars.source(vars::EZA_GRID_ROWS, vars::EXA_GRID_ROWS).unwrap());
                     Err(OptionsError::FailedParse(columns, source, e))
                 }
             }

+ 1 - 1
src/output/grid_details.rs

@@ -196,7 +196,7 @@ impl<'a> Render<'a> {
                 let last_column_count = if the_grid_fits { column_count } else { column_count - 1 };
                 // If we’ve figured out how many columns can fit in the user’s terminal,
                 // and it turns out there aren’t enough rows to make it worthwhile
-                // (according to EXA_GRID_ROWS), then just resort to the lines view.
+                // (according to EZA_GRID_ROWS), then just resort to the lines view.
                 if let RowThreshold::MinimumRows(thresh) = self.row_threshold {
                     if last_working_grid.fit_into_columns(last_column_count).row_count() < thresh {
                         return None;

+ 5 - 5
src/theme/mod.rs

@@ -94,7 +94,7 @@ impl Definitions {
     /// colours into the `ExtensionMappings` that gets returned, and using the
     /// two-character UI codes to modify the mutable `Colours`.
     ///
-    /// Also returns if the `EXA_COLORS` variable should reset the existing file
+    /// Also returns if the `EZA_COLORS` variable should reset the existing file
     /// type mappings or not. The `reset` code needs to be the first one.
     fn parse_color_vars(&self, colours: &mut UiStyles) -> (ExtensionMappings, bool) {
         use log::*;
@@ -473,7 +473,7 @@ mod customs_test {
     test!(ls_ln:   ls "ln=34", exa ""  =>  colours c -> { c.filekinds.symlink      = Blue.normal();   });
     test!(ls_or:   ls "or=33", exa ""  =>  colours c -> { c.broken_symlink         = Yellow.normal(); });
 
-    // EXA_COLORS can affect all those colours too:
+    // EZA_COLORS can affect all those colours too:
     test!(exa_di:  ls "", exa "di=32"  =>  colours c -> { c.filekinds.directory    = Green.normal();  });
     test!(exa_ex:  ls "", exa "ex=33"  =>  colours c -> { c.filekinds.executable   = Yellow.normal(); });
     test!(exa_fi:  ls "", exa "fi=34"  =>  colours c -> { c.filekinds.normal       = Blue.normal();   });
@@ -484,12 +484,12 @@ mod customs_test {
     test!(exa_ln:  ls "", exa "ln=33"  =>  colours c -> { c.filekinds.symlink      = Yellow.normal(); });
     test!(exa_or:  ls "", exa "or=32"  =>  colours c -> { c.broken_symlink         = Green.normal();  });
 
-    // EXA_COLORS will even override options from LS_COLORS:
+    // EZA_COLORS will even override options from LS_COLORS:
     test!(ls_exa_di: ls "di=31", exa "di=32"  =>  colours c -> { c.filekinds.directory  = Green.normal();  });
     test!(ls_exa_ex: ls "ex=32", exa "ex=33"  =>  colours c -> { c.filekinds.executable = Yellow.normal(); });
     test!(ls_exa_fi: ls "fi=33", exa "fi=34"  =>  colours c -> { c.filekinds.normal     = Blue.normal();   });
 
-    // But more importantly, EXA_COLORS has its own, special list of colours:
+    // But more importantly, EZA_COLORS has its own, special list of colours:
     test!(exa_ur:  ls "", exa "ur=38;5;100"  =>  colours c -> { c.perms.user_read           = Fixed(100).normal(); });
     test!(exa_uw:  ls "", exa "uw=38;5;101"  =>  colours c -> { c.perms.user_write          = Fixed(101).normal(); });
     test!(exa_ux:  ls "", exa "ux=38;5;102"  =>  colours c -> { c.perms.user_execute_file   = Fixed(102).normal(); });
@@ -594,7 +594,7 @@ mod customs_test {
     test!(exa_mp3: ls "", exa "lev.*=38;5;153"     =>  exts [ ("lev.*",      Fixed(153).normal())      ]);
     test!(exa_mak: ls "", exa "Cargo.toml=4;32;1"  =>  exts [ ("Cargo.toml", Green.bold().underline()) ]);
 
-    // Testing whether a glob from EXA_COLORS overrides a glob from LS_COLORS
+    // Testing whether a glob from EZA_COLORS overrides a glob from LS_COLORS
     // can’t be tested here, because they’ll both be added to the same vec
 
     // Values get separated by colons:

+ 1 - 1
src/theme/ui_styles.rs

@@ -169,7 +169,7 @@ impl UiStyles {
     }
 
     /// Sets a value on this set of colours using one of the keys understood
-    /// by the `EXA_COLORS` environment variable. Invalid keys set nothing,
+    /// by the `EZA_COLORS` environment variable. Invalid keys set nothing,
     /// but return false. This doesn’t take the `LS_COLORS` keys into account,
     /// so `set_ls` should have been run first.
     pub fn set_exa(&mut self, pair: &Pair<'_>) -> bool {

+ 6 - 3
treefmt.nix

@@ -1,9 +1,12 @@
 {
   projectRootFile = "Cargo.toml";
   programs = {
-    alejandra.enable = true;
-    rustfmt.enable = true;
-    shellcheck.enable = true;
+    alejandra.enable = true; # nix
+    rustfmt.enable = true; # rust
+    shellcheck.enable = true; # bash/shell
+    deadnix.enable = true; # find dead nix code
+    taplo.enable = true; # toml
+    yamlfmt.enable = true; # yaml
   };
   settings = {
     formatter.shellcheck.includes = ["*.sh" "./completions/bash/eza"];