From aab1d3db59f33bc2fde975ffb9e7c9209a9ec4e1 Mon Sep 17 00:00:00 2001 From: Max Zhuravsky Date: Thu, 25 Nov 2021 23:37:02 +0300 Subject: [PATCH 01/24] [no-color] - implement NO_COLOR support --- .gitignore | 3 +++ src/options/theme.rs | 11 ++++++++--- src/options/vars.rs | 3 +++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index ede6ac0..0ae41f6 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,6 @@ parts prime stage *.snap + +# IntelliJ IDEA files +.idea diff --git a/src/options/theme.rs b/src/options/theme.rs index 02309f7..12d24ec 100644 --- a/src/options/theme.rs +++ b/src/options/theme.rs @@ -5,7 +5,7 @@ use crate::theme::{Options, UseColours, ColourScale, Definitions}; impl Options { pub fn deduce(matches: &MatchedFlags<'_>, vars: &V) -> Result { - let use_colours = UseColours::deduce(matches)?; + let use_colours = UseColours::deduce(matches, vars)?; let colour_scale = ColourScale::deduce(matches)?; let definitions = if use_colours == UseColours::Never { @@ -21,10 +21,15 @@ impl Options { impl UseColours { - fn deduce(matches: &MatchedFlags<'_>) -> Result { + fn deduce(matches: &MatchedFlags<'_>, vars: &V) -> Result { + let default_value = match vars.get(vars::NO_COLOR) { + Some(_) => Self::Never, + None => Self::Automatic, + }; + let word = match matches.get_where(|f| f.matches(&flags::COLOR) || f.matches(&flags::COLOUR))? { Some(w) => w, - None => return Ok(Self::Automatic), + None => return Ok(default_value), }; if word == "always" { diff --git a/src/options/vars.rs b/src/options/vars.rs index a8fc40e..9ce6cc5 100644 --- a/src/options/vars.rs +++ b/src/options/vars.rs @@ -15,6 +15,9 @@ pub static COLUMNS: &str = "COLUMNS"; /// Environment variable used to datetime format. pub static TIME_STYLE: &str = "TIME_STYLE"; +/// Environment variable used to disable colors. +/// See: https://no-color.org/ +pub static NO_COLOR: &str = "NO_COLOR"; // exa-specific variables From a371c41711af22235ef258cf545288407475a0c1 Mon Sep 17 00:00:00 2001 From: Max Zhuravsky Date: Fri, 26 Nov 2021 01:45:41 +0300 Subject: [PATCH 02/24] [no-color] - add unit test and doc --- man/exa.1.md | 6 ++++ src/options/theme.rs | 76 ++++++++++++++++++++++++++++++++++---------- 2 files changed, 65 insertions(+), 17 deletions(-) diff --git a/man/exa.1.md b/man/exa.1.md index bd91a7c..24cec4f 100644 --- a/man/exa.1.md +++ b/man/exa.1.md @@ -224,6 +224,12 @@ Specifies the number of spaces to print between an icon (see the ‘`--icons`’ Different terminals display icons differently, as they usually take up more than one character width on screen, so there’s no “standard” number of spaces that exa can use to separate an icon from text. One space may place the icon too close to the text, and two spaces may place it too far away. So the choice is left up to the user to configure depending on their terminal emulator. +## `NO_COLOR` + +Disables ANSI colour in the output (regardless of its value). Can be overridden by `--color` option. + +See `https://no-color.org/` for details. + ## `LS_COLORS`, `EXA_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. diff --git a/src/options/theme.rs b/src/options/theme.rs index 12d24ec..010de4a 100644 --- a/src/options/theme.rs +++ b/src/options/theme.rs @@ -92,6 +92,16 @@ mod terminal_test { } }; + ($name:ident: $type:ident <- $inputs:expr, $env:expr; $stricts:expr => $result:expr) => { + #[test] + fn $name() { + let env = $env; + for result in parse_for_test($inputs.as_ref(), TEST_ARGS, $stricts, |mf| $type::deduce(mf, &env)) { + assert_eq!(result, $result); + } + } + }; + ($name:ident: $type:ident <- $inputs:expr; $stricts:expr => err $result:expr) => { #[test] fn $name() { @@ -100,11 +110,39 @@ mod terminal_test { } } }; + + ($name:ident: $type:ident <- $inputs:expr, $env:expr; $stricts:expr => err $result:expr) => { + #[test] + fn $name() { + let env = $env; + for result in parse_for_test($inputs.as_ref(), TEST_ARGS, $stricts, |mf| $type::deduce(mf, &env)) { + assert_eq!(result.unwrap_err(), $result); + } + } + }; } struct MockVars { ls: &'static str, exa: &'static str, + no_color: &'static str, + } + + impl MockVars { + fn empty() -> MockVars { + return MockVars { + ls: "", + exa: "", + no_color: "", + }; + } + fn with_no_color() -> MockVars { + return MockVars { + ls: "", + exa: "", + no_color: "true", + }; + } } // Test impl that just returns the value it has. @@ -116,6 +154,9 @@ mod terminal_test { else if name == vars::EXA_COLORS && ! self.exa.is_empty() { Some(OsString::from(self.exa.clone())) } + else if name == vars::NO_COLOR && ! self.no_color.is_empty() { + Some(OsString::from(self.no_color.clone())) + } else { None } @@ -125,32 +166,33 @@ mod terminal_test { // Default - test!(empty: UseColours <- []; Both => Ok(UseColours::Automatic)); + test!(empty: UseColours <- [], MockVars::empty(); Both => Ok(UseColours::Automatic)); + test!(empty_with_no_color: UseColours <- [], MockVars::with_no_color(); Both => Ok(UseColours::Never)); // --colour - test!(u_always: UseColours <- ["--colour=always"]; Both => Ok(UseColours::Always)); - test!(u_auto: UseColours <- ["--colour", "auto"]; Both => Ok(UseColours::Automatic)); - test!(u_never: UseColours <- ["--colour=never"]; Both => Ok(UseColours::Never)); + test!(u_always: UseColours <- ["--colour=always"], MockVars::empty(); Both => Ok(UseColours::Always)); + test!(u_auto: UseColours <- ["--colour", "auto"], MockVars::empty(); Both => Ok(UseColours::Automatic)); + test!(u_never: UseColours <- ["--colour=never"], MockVars::empty(); Both => Ok(UseColours::Never)); // --color - test!(no_u_always: UseColours <- ["--color", "always"]; Both => Ok(UseColours::Always)); - test!(no_u_auto: UseColours <- ["--color=auto"]; Both => Ok(UseColours::Automatic)); - test!(no_u_never: UseColours <- ["--color", "never"]; Both => Ok(UseColours::Never)); + test!(no_u_always: UseColours <- ["--color", "always"], MockVars::empty(); Both => Ok(UseColours::Always)); + test!(no_u_auto: UseColours <- ["--color=auto"], MockVars::empty(); Both => Ok(UseColours::Automatic)); + test!(no_u_never: UseColours <- ["--color", "never"], MockVars::empty(); Both => Ok(UseColours::Never)); // Errors - test!(no_u_error: UseColours <- ["--color=upstream"]; Both => err OptionsError::BadArgument(&flags::COLOR, OsString::from("upstream"))); // the error is for --color - test!(u_error: UseColours <- ["--colour=lovers"]; Both => err OptionsError::BadArgument(&flags::COLOR, OsString::from("lovers"))); // and so is this one! + test!(no_u_error: UseColours <- ["--color=upstream"], MockVars::empty(); Both => err OptionsError::BadArgument(&flags::COLOR, OsString::from("upstream"))); // the error is for --color + test!(u_error: UseColours <- ["--colour=lovers"], MockVars::empty(); Both => err OptionsError::BadArgument(&flags::COLOR, OsString::from("lovers"))); // and so is this one! // Overriding - test!(overridden_1: UseColours <- ["--colour=auto", "--colour=never"]; Last => Ok(UseColours::Never)); - test!(overridden_2: UseColours <- ["--color=auto", "--colour=never"]; Last => Ok(UseColours::Never)); - test!(overridden_3: UseColours <- ["--colour=auto", "--color=never"]; Last => Ok(UseColours::Never)); - test!(overridden_4: UseColours <- ["--color=auto", "--color=never"]; Last => Ok(UseColours::Never)); + test!(overridden_1: UseColours <- ["--colour=auto", "--colour=never"], MockVars::empty(); Last => Ok(UseColours::Never)); + test!(overridden_2: UseColours <- ["--color=auto", "--colour=never"], MockVars::empty(); Last => Ok(UseColours::Never)); + test!(overridden_3: UseColours <- ["--colour=auto", "--color=never"], MockVars::empty(); Last => Ok(UseColours::Never)); + test!(overridden_4: UseColours <- ["--color=auto", "--color=never"], MockVars::empty(); Last => Ok(UseColours::Never)); - test!(overridden_5: UseColours <- ["--colour=auto", "--colour=never"]; Complain => err OptionsError::Duplicate(Flag::Long("colour"), Flag::Long("colour"))); - test!(overridden_6: UseColours <- ["--color=auto", "--colour=never"]; Complain => err OptionsError::Duplicate(Flag::Long("color"), Flag::Long("colour"))); - test!(overridden_7: UseColours <- ["--colour=auto", "--color=never"]; Complain => err OptionsError::Duplicate(Flag::Long("colour"), Flag::Long("color"))); - test!(overridden_8: UseColours <- ["--color=auto", "--color=never"]; Complain => err OptionsError::Duplicate(Flag::Long("color"), Flag::Long("color"))); + test!(overridden_5: UseColours <- ["--colour=auto", "--colour=never"], MockVars::empty(); Complain => err OptionsError::Duplicate(Flag::Long("colour"), Flag::Long("colour"))); + test!(overridden_6: UseColours <- ["--color=auto", "--colour=never"], MockVars::empty(); Complain => err OptionsError::Duplicate(Flag::Long("color"), Flag::Long("colour"))); + test!(overridden_7: UseColours <- ["--colour=auto", "--color=never"], MockVars::empty(); Complain => err OptionsError::Duplicate(Flag::Long("colour"), Flag::Long("color"))); + test!(overridden_8: UseColours <- ["--color=auto", "--color=never"], MockVars::empty(); Complain => err OptionsError::Duplicate(Flag::Long("color"), Flag::Long("color"))); test!(scale_1: ColourScale <- ["--color-scale", "--colour-scale"]; Last => Ok(ColourScale::Gradient)); test!(scale_2: ColourScale <- ["--color-scale", ]; Last => Ok(ColourScale::Gradient)); From df4fb84ae19267b534beb94560da524fc72f436b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9lanie=20Chauvel?= Date: Sun, 5 Dec 2021 18:22:38 +0100 Subject: [PATCH 03/24] =?UTF-8?q?don=E2=80=99t=20display=20broken=20pipe?= =?UTF-8?q?=20error=20messages=20(see=20rust-lang/rust#46016)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.rs b/src/main.rs index 6730993..ef46fc8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,6 +50,10 @@ mod theme; fn main() { use std::process::exit; + unsafe { + libc::signal(libc::SIGPIPE, libc::SIG_DFL); + } + logger::configure(env::var_os(vars::EXA_DEBUG)); let args: Vec<_> = env::args_os().skip(1).collect(); From c6874f0b3276b21a8a4ea02e06bef1a20d8af412 Mon Sep 17 00:00:00 2001 From: Max Zhuravsky Date: Mon, 6 Dec 2021 02:03:47 +0300 Subject: [PATCH 04/24] [baseline] - fix docs and remove gitignore --- .gitignore | 3 --- man/exa.1.md | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 0ae41f6..ede6ac0 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,3 @@ parts prime stage *.snap - -# IntelliJ IDEA files -.idea diff --git a/man/exa.1.md b/man/exa.1.md index 24cec4f..7bafd3f 100644 --- a/man/exa.1.md +++ b/man/exa.1.md @@ -226,7 +226,7 @@ Different terminals display icons differently, as they usually take up more than ## `NO_COLOR` -Disables ANSI colour in the output (regardless of its value). Can be overridden by `--color` option. +Disables colours in the output (regardless of its value). Can be overridden by `--color` option. See `https://no-color.org/` for details. From 2ac7024197a521f90271948820f91f715ec4f64d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9lanie=20Chauvel?= Date: Fri, 10 Dec 2021 00:15:12 +0100 Subject: [PATCH 05/24] Ignore all log files (produced by Vagrant) --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ede6ac0..cb7baef 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ target # Vagrant stuff .vagrant -ubuntu-xenial-16.04-cloudimg-console.log +*.log # Compiled artifacts # (see devtools/*-package-for-*.sh) From ef8fd32dc608669e23c6a9fd6f1afe5233f4c427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9lanie=20Chauvel?= Date: Thu, 12 Aug 2021 16:46:37 +0200 Subject: [PATCH 06/24] Update MSRV and add it in rust-toolchain.toml --- .github/workflows/unit-tests.yml | 2 +- README.md | 6 +++--- rust-toolchain.toml | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 rust-toolchain.toml diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 4071b3a..05b7d54 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -28,7 +28,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] - rust: [1.48.0, stable, beta, nightly] + rust: [1.56.1, stable, beta, nightly] steps: - name: Checkout repository diff --git a/README.md b/README.md index ec4749f..c8c4e03 100644 --- a/README.md +++ b/README.md @@ -197,8 +197,8 @@ To build without Git support, run `cargo install --no-default-features exa` is a

Development - - Rust 1.45.2+ + + Rust 1.56.1+ @@ -207,7 +207,7 @@ To build without Git support, run `cargo install --no-default-features exa` is a

exa is written in [Rust](https://www.rust-lang.org/). -You will need rustc version 1.45.2 or higher. +You will need rustc version 1.56.1 or higher. The recommended way to install Rust for development is from the [official download page](https://www.rust-lang.org/tools/install), using rustup. Once Rust is installed, you can compile exa with Cargo: diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..071aaaa --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "1.56.1" From af208285e8a0fb383f59372c966bdb77f94006e9 Mon Sep 17 00:00:00 2001 From: Bastien Orivel Date: Fri, 10 Dec 2021 13:21:13 +0100 Subject: [PATCH 07/24] Update term_grid to 0.2 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- src/output/grid.rs | 1 + src/output/grid_details.rs | 2 ++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f62bbc9..5ee181d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,9 +279,9 @@ checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" [[package]] name = "term_grid" -version = "0.1.7" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "230d3e804faaed5a39b08319efb797783df2fd9671b39b7596490cb486d702cf" +checksum = "a7c9eb7705cb3f0fd71d3955b23db6d372142ac139e8c473952c93bf3c3dc4b7" dependencies = [ "unicode-width", ] diff --git a/Cargo.toml b/Cargo.toml index d2923f5..18aeacd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ natord = "1.0" num_cpus = "1.10" number_prefix = "0.4" scoped_threadpool = "0.1" -term_grid = "0.1" +term_grid = "0.2.0" terminal_size = "0.1.16" unicode-width = "0.1" users = "0.11" diff --git a/src/output/grid.rs b/src/output/grid.rs index 290ee8b..0e1b694 100644 --- a/src/output/grid.rs +++ b/src/output/grid.rs @@ -46,6 +46,7 @@ impl<'a> Render<'a> { grid.add(tg::Cell { contents: filename.strings().to_string(), width: *filename.width(), + alignment: tg::Alignment::Left, }); } diff --git a/src/output/grid_details.rs b/src/output/grid_details.rs index 088d7a8..fd096da 100644 --- a/src/output/grid_details.rs +++ b/src/output/grid_details.rs @@ -263,6 +263,7 @@ impl<'a> Render<'a> { let cell = grid::Cell { contents: ANSIStrings(&column[row].contents).to_string(), width: *column[row].width, + alignment: grid::Alignment::Left, }; grid.add(cell); @@ -276,6 +277,7 @@ impl<'a> Render<'a> { let cell = grid::Cell { contents: ANSIStrings(&cell.contents).to_string(), width: *cell.width, + alignment: grid::Alignment::Left, }; grid.add(cell); From 69ae5db3b6aa04d0e31f6ad481cb6a1858316314 Mon Sep 17 00:00:00 2001 From: Scott B Date: Fri, 10 Dec 2021 18:04:57 -0800 Subject: [PATCH 08/24] add zst file icon --- src/output/icons.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/output/icons.rs b/src/output/icons.rs index eb7666a..bc8939d 100644 --- a/src/output/icons.rs +++ b/src/output/icons.rs @@ -345,6 +345,7 @@ pub fn icon_for_file(file: &File<'_>) -> char { "zsh" => '\u{f489}', //  "zsh-theme" => '\u{f489}', //  "zshrc" => '\u{f489}', //  + "zst" => '\u{f410}', //  _ => '\u{f15b}' //  } } From c4b8e7af1ac27643f6e276467236654f30f8c785 Mon Sep 17 00:00:00 2001 From: Scott B Date: Fri, 10 Dec 2021 18:21:03 -0800 Subject: [PATCH 09/24] add PKGBUILD file icon --- src/output/icons.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/output/icons.rs b/src/output/icons.rs index bc8939d..f1327db 100644 --- a/src/output/icons.rs +++ b/src/output/icons.rs @@ -83,6 +83,7 @@ lazy_static! { m.insert("Makefile", '\u{f489}'); //  m.insert("node_modules", '\u{e718}'); //  m.insert("npmignore", '\u{e71e}'); //  + m.insert("PKGBUILD", '\u{f303}'); //  m.insert("rubydoc", '\u{e73b}'); //  m.insert("yarn.lock", '\u{e718}'); //  From 859666d2870c7c83a4987fe73b025777d7cd8b02 Mon Sep 17 00:00:00 2001 From: Ashin Antony <83629316+ashincoder@users.noreply.github.com> Date: Tue, 14 Dec 2021 17:46:30 +0530 Subject: [PATCH 10/24] feat: Add julia file extension icon Icon for julia file extension '.jl' is added to the icons list. --- src/output/icons.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/output/icons.rs b/src/output/icons.rs index eb7666a..aa27ead 100644 --- a/src/output/icons.rs +++ b/src/output/icons.rs @@ -210,6 +210,7 @@ pub fn icon_for_file(file: &File<'_>) -> char { "jfi" => '\u{f1c5}', //  "jfif" => '\u{f1c5}', //  "jif" => '\u{f1c5}', //  + "jl" => '\u{e624}', //  "jpe" => '\u{f1c5}', //  "jpeg" => '\u{f1c5}', //  "jpg" => '\u{f1c5}', //  From 091ab51b983a1dfaf9e3ef3e0eddaf46ac26a896 Mon Sep 17 00:00:00 2001 From: cab-1729 <60106638+cab-1729@users.noreply.github.com> Date: Wed, 15 Dec 2021 21:08:30 +0530 Subject: [PATCH 11/24] Add files via upload --- src/output/icons.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/output/icons.rs b/src/output/icons.rs index eb7666a..aa779bd 100644 --- a/src/output/icons.rs +++ b/src/output/icons.rs @@ -255,6 +255,7 @@ pub fn icon_for_file(file: &File<'_>) -> char { "ogg" => '\u{f001}', //  "ogv" => '\u{f03d}', //  "otf" => '\u{f031}', //  + "part" => '\u{f43a}', //  "patch" => '\u{f440}', //  "pdf" => '\u{f1c1}', //  "php" => '\u{e73d}', //  @@ -314,6 +315,7 @@ pub fn icon_for_file(file: &File<'_>) -> char { "tiff" => '\u{f1c5}', //  "tlz" => '\u{f410}', //  "toml" => '\u{e615}', //  + "torrent" => '\u{e275}', //  "ts" => '\u{e628}', //  "tsv" => '\u{f1c3}', //  "tsx" => '\u{e7ba}', //  From c3eb8321ff215211062f47ca5e3dc2bc8b9555b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc?= <88983487+loicreynier@users.noreply.github.com> Date: Sun, 26 Dec 2021 12:26:25 +0100 Subject: [PATCH 12/24] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index c8c4e03..dc9e45b 100644 --- a/README.md +++ b/README.md @@ -121,8 +121,7 @@ On Android / Termux, install the [`exa`](https://github.com/termux/termux-packag ### Debian -On Debian, install the [`exa`](https://packages.debian.org/unstable/exa) package. -For now, exa is in the _unstable_ repository. +On Debian, install the [`exa`](https://packages.debian.org/stable/exa) package. $ apt install exa From 89d537adb47743980b9b1722c590556e36e66b0b Mon Sep 17 00:00:00 2001 From: Sam James Date: Mon, 3 Jan 2022 04:37:47 +0000 Subject: [PATCH 13/24] icons: add Gentoo for .ebuild Signed-off-by: Sam James --- src/output/icons.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/output/icons.rs b/src/output/icons.rs index aa27ead..888385d 100644 --- a/src/output/icons.rs +++ b/src/output/icons.rs @@ -156,6 +156,7 @@ pub fn icon_for_file(file: &File<'_>) -> char { "DS_store" => '\u{f179}', //  "dump" => '\u{f1c0}', //  "ebook" => '\u{e28b}', //  + "ebuild" => '\u{f30d}', //  "editorconfig" => '\u{e615}', //  "ejs" => '\u{e618}', //  "elm" => '\u{e62c}', //  From 352a1e8f196084e24a13dfd1cf22610c24d48a6b Mon Sep 17 00:00:00 2001 From: KOSHIKAWA Kenichi Date: Mon, 3 Jan 2022 22:57:34 +0900 Subject: [PATCH 14/24] src/main.rs: remove clippy::unnested_or_patterns Signed-off-by: KOSHIKAWA Kenichi --- src/main.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index ef46fc8..bbdf0d6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,7 +18,6 @@ #![allow(clippy::non_ascii_literal)] #![allow(clippy::option_if_let_else)] #![allow(clippy::too_many_lines)] -#![allow(clippy::unnested_or_patterns)] // TODO: remove this when we support Rust 1.53.0 #![allow(clippy::unused_self)] #![allow(clippy::upper_case_acronyms)] #![allow(clippy::wildcard_imports)] From 42659f93456d9ff7cc1096cbd84d778ede26d76e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20H=C3=B6ltje?= Date: Tue, 4 Jan 2022 18:10:24 -0500 Subject: [PATCH 15/24] add icon for .bats files (#968) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add icon for .bats files This adds the same icon as BASH for `.bats` files. Co-authored-by: Mélanie Chauvel --- src/output/icons.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/output/icons.rs b/src/output/icons.rs index 6efc761..357137a 100644 --- a/src/output/icons.rs +++ b/src/output/icons.rs @@ -119,6 +119,7 @@ pub fn icon_for_file(file: &File<'_>) -> char { "bash_profile" => '\u{f489}', //  "bashrc" => '\u{f489}', //  "bat" => '\u{f17a}', //  + "bats" => '\u{f489}', //  "bmp" => '\u{f1c5}', //  "bz" => '\u{f410}', //  "bz2" => '\u{f410}', //  From e433b3fed0d852467f8772ae2ef7ac878d8eb922 Mon Sep 17 00:00:00 2001 From: Jacob Vaverka <47707103+jvaverka@users.noreply.github.com> Date: Mon, 10 Jan 2022 11:46:23 -0500 Subject: [PATCH 16/24] Update icons.rs Add Markdown icon for Julia Markdown documents (same convention as for `*.Rmd`) --- src/output/icons.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/output/icons.rs b/src/output/icons.rs index 357137a..cb5771c 100644 --- a/src/output/icons.rs +++ b/src/output/icons.rs @@ -214,6 +214,7 @@ pub fn icon_for_file(file: &File<'_>) -> char { "jfif" => '\u{f1c5}', //  "jif" => '\u{f1c5}', //  "jl" => '\u{e624}', //  + "jmd" => '\u{f48a}', //  "jpe" => '\u{f1c5}', //  "jpeg" => '\u{f1c5}', //  "jpg" => '\u{f1c5}', //  From f0b9cceb73ef8e8b4a02086b341fd792ec211262 Mon Sep 17 00:00:00 2001 From: Wesley Date: Sat, 15 Jan 2022 00:25:27 +0100 Subject: [PATCH 17/24] Make it easy to copy and paste --- README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index c8c4e03..63962d3 100644 --- a/README.md +++ b/README.md @@ -105,74 +105,74 @@ More information on how to install exa is available on [the Installation page](h On Alpine Linux, [enable community repository](https://wiki.alpinelinux.org/wiki/Enable_Community_Repository) and install the [`exa`](https://pkgs.alpinelinux.org/package/edge/community/x86_64/exa) package. - $ apk add exa + apk add exa ### Arch Linux On Arch, install the [`exa`](https://www.archlinux.org/packages/community/x86_64/exa/) package. - $ pacman -S exa + pacman -S exa ### Android / Termux On Android / Termux, install the [`exa`](https://github.com/termux/termux-packages/tree/master/packages/exa) package. - $ pkg install exa + pkg install exa ### Debian On Debian, install the [`exa`](https://packages.debian.org/unstable/exa) package. For now, exa is in the _unstable_ repository. - $ apt install exa + apt install exa ### Fedora On Fedora, install the [`exa`](https://src.fedoraproject.org/modules/exa) package. - $ dnf install exa + dnf install exa ### Gentoo On Gentoo, install the [`sys-apps/exa`](https://packages.gentoo.org/packages/sys-apps/exa) package. - $ emerge sys-apps/exa + emerge sys-apps/exa ### Homebrew If you’re using [Homebrew](https://brew.sh/) on macOS, install the [`exa`](http://formulae.brew.sh/formula/exa) formula. - $ brew install exa + brew install exa ### MacPorts If you're using [MacPorts](https://www.macports.org/) on macOS, install the [`exa`](https://ports.macports.org/port/exa/summary) port. - $ port install exa + port install exa ### Nix On nixOS, install the [`exa`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/misc/exa/default.nix) package. - $ nix-env -i exa + nix-env -i exa ### openSUSE On openSUSE, install the [`exa`](https://software.opensuse.org/package/exa) package. - $ zypper install exa + zypper install exa ### Ubuntu On Ubuntu 20.10 (Groovy Gorilla) and later, install the [`exa`](https://packages.ubuntu.com/groovy/exa) package. - $ sudo apt install exa + sudo apt install exa ### Void Linux On Void Linux, install the [`exa`](https://github.com/void-linux/void-packages/blob/master/srcpkgs/exa/template) package. - $ xbps-install -S exa + xbps-install -S exa ### Manual installation from GitHub @@ -185,7 +185,7 @@ For more information, see the [Manual Installation page](https://the.exa.website If you already have a Rust environment set up, you can use the `cargo install` command: - $ cargo install exa + cargo install exa Cargo will build the `exa` binary and place it in `$HOME/.cargo`. @@ -212,8 +212,8 @@ The recommended way to install Rust for development is from the [official downlo Once Rust is installed, you can compile exa with Cargo: - $ cargo build - $ cargo test + cargo build + cargo test - The [just](https://github.com/casey/just) command runner can be used to run some helpful development commands, in a manner similar to `make`. Run `just --tasks` to get an overview of what’s available. From 400bb0a140f4f93cf4c2ea3cc4fe6f957af8d28b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20P=C3=A9rez?= Date: Sun, 23 Jan 2022 19:52:06 +0100 Subject: [PATCH 18/24] Use same icon for lib, xml & xul files (fix #891) --- src/output/icons.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/output/icons.rs b/src/output/icons.rs index 357137a..40484f9 100644 --- a/src/output/icons.rs +++ b/src/output/icons.rs @@ -342,8 +342,8 @@ pub fn icon_for_file(file: &File<'_>) -> char { "xhtml" => '\u{f13b}', //  "xls" => '\u{f1c3}', //  "xlsx" => '\u{f1c3}', //  - "xml" => '\u{fabf}', // 謹 - "xul" => '\u{fabf}', // 謹 + "xml" => '\u{f121}', //  + "xul" => '\u{f121}', //  "xz" => '\u{f410}', //  "yaml" => '\u{f481}', //  "yml" => '\u{f481}', //  From c968c388d483dfe80014147bda6e766b78cd201f Mon Sep 17 00:00:00 2001 From: Abhilash Balaji Date: Thu, 17 Mar 2022 14:51:22 +0100 Subject: [PATCH 19/24] workaround for num_cpus returning 0 (#1034) workaround for num_cpus returning 0 --- src/output/details.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/output/details.rs b/src/output/details.rs index 9dca7d4..62ef7d8 100644 --- a/src/output/details.rs +++ b/src/output/details.rs @@ -147,7 +147,11 @@ impl<'a> AsRef> for Egg<'a> { impl<'a> Render<'a> { pub fn render(mut self, w: &mut W) -> io::Result<()> { - let mut pool = Pool::new(num_cpus::get() as u32); + let n_cpus = match num_cpus::get() as u32 { + 0 => 1, + n => n, + }; + let mut pool = Pool::new(n_cpus); let mut rows = Vec::new(); if let Some(ref table) = self.opts.table { From fe646900637ea9d80ecbe5baa341b24444ed1497 Mon Sep 17 00:00:00 2001 From: Philippe Eberli Date: Thu, 17 Mar 2022 18:05:37 +0100 Subject: [PATCH 20/24] Change icon for gradle files to Java (#1017) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Change icon for gradle files to Java Gradle files are for the whole Java ecosystem. Not just Android. * Change the icon for jar & java to  Other java related files (class, jad, war) already use this. --- src/output/icons.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/output/icons.rs b/src/output/icons.rs index 357137a..fa90c4f 100644 --- a/src/output/icons.rs +++ b/src/output/icons.rs @@ -69,7 +69,7 @@ lazy_static! { m.insert("Dockerfile", '\u{f308}'); //  m.insert("ds_store", '\u{f179}'); //  m.insert("gitignore_global", '\u{f1d3}'); //  - m.insert("gradle", '\u{e70e}'); //  + m.insert("gradle", '\u{e256}'); //  m.insert("gruntfile.coffee", '\u{e611}'); //  m.insert("gruntfile.js", '\u{e611}'); //  m.insert("gruntfile.ls", '\u{e611}'); //  @@ -188,7 +188,7 @@ pub fn icon_for_file(file: &File<'_>) -> char { "gitignore" => '\u{f1d3}', //  "gitmodules" => '\u{f1d3}', //  "go" => '\u{e626}', //  - "gradle" => '\u{e70e}', //  + "gradle" => '\u{e256}', //  "groovy" => '\u{e775}', //  "gsheet" => '\u{f1c3}', //  "gslides" => '\u{f1c4}', //  @@ -208,8 +208,8 @@ pub fn icon_for_file(file: &File<'_>) -> char { "ipynb" => '\u{e606}', //  "iso" => '\u{e271}', //  "jad" => '\u{e256}', //  - "jar" => '\u{e204}', //  - "java" => '\u{e204}', //  + "jar" => '\u{e256}', //  + "java" => '\u{e256}', //  "jfi" => '\u{f1c5}', //  "jfif" => '\u{f1c5}', //  "jif" => '\u{f1c5}', //  From f5bbfa787185f4944a76d611b7d0ef14c4279c83 Mon Sep 17 00:00:00 2001 From: Shun Sakai Date: Fri, 18 Mar 2022 16:51:06 +0900 Subject: [PATCH 21/24] Add cpio filetype --- src/info/filetype.rs | 2 +- src/output/icons.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/info/filetype.rs b/src/info/filetype.rs index 3011d5f..e9c2720 100644 --- a/src/info/filetype.rs +++ b/src/info/filetype.rs @@ -80,7 +80,7 @@ impl FileExtensions { file.extension_is_one_of( &[ "zip", "tar", "Z", "z", "gz", "bz2", "a", "ar", "7z", "iso", "dmg", "tc", "rar", "par", "tgz", "xz", "txz", - "lz", "tlz", "lzma", "deb", "rpm", "zst", "lz4", + "lz", "tlz", "lzma", "deb", "rpm", "zst", "lz4", "cpio", ]) } diff --git a/src/output/icons.rs b/src/output/icons.rs index 1450a85..a90cf35 100644 --- a/src/output/icons.rs +++ b/src/output/icons.rs @@ -136,6 +136,7 @@ pub fn icon_for_file(file: &File<'_>) -> char { "coffee" => '\u{f0f4}', //  "conf" => '\u{e615}', //  "cp" => '\u{e61d}', //  + "cpio" => '\u{f410}', //  "cpp" => '\u{e61d}', //  "cs" => '\u{f81a}', //  "csh" => '\u{f489}', //  From bced9841f4e140e2ea146960a2495a71d5a48f70 Mon Sep 17 00:00:00 2001 From: Shun Sakai Date: Fri, 18 Mar 2022 18:07:30 +0900 Subject: [PATCH 22/24] Add JPEG 2000 filetype --- src/info/filetype.rs | 3 ++- src/output/icons.rs | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/info/filetype.rs b/src/info/filetype.rs index 3011d5f..4b38aa4 100644 --- a/src/info/filetype.rs +++ b/src/info/filetype.rs @@ -38,7 +38,8 @@ impl FileExtensions { "png", "jfi", "jfif", "jif", "jpe", "jpeg", "jpg", "gif", "bmp", "tiff", "tif", "ppm", "pgm", "pbm", "pnm", "webp", "raw", "arw", "svg", "stl", "eps", "dvi", "ps", "cbr", "jpf", "cbz", "xpm", - "ico", "cr2", "orf", "nef", "heif", "avif", "jxl", + "ico", "cr2", "orf", "nef", "heif", "avif", "jxl", "j2k", "jp2", + "j2c", "jpx", ]) } diff --git a/src/output/icons.rs b/src/output/icons.rs index 1450a85..6dead88 100644 --- a/src/output/icons.rs +++ b/src/output/icons.rs @@ -207,6 +207,8 @@ pub fn icon_for_file(file: &File<'_>) -> char { "ini" => '\u{f17a}', //  "ipynb" => '\u{e606}', //  "iso" => '\u{e271}', //  + "j2c" => '\u{f1c5}', //  + "j2k" => '\u{f1c5}', //  "jad" => '\u{e256}', //  "jar" => '\u{e256}', //  "java" => '\u{e256}', //  @@ -215,9 +217,11 @@ pub fn icon_for_file(file: &File<'_>) -> char { "jif" => '\u{f1c5}', //  "jl" => '\u{e624}', //  "jmd" => '\u{f48a}', //  + "jp2" => '\u{f1c5}', //  "jpe" => '\u{f1c5}', //  "jpeg" => '\u{f1c5}', //  "jpg" => '\u{f1c5}', //  + "jpx" => '\u{f1c5}', //  "js" => '\u{e74e}', //  "json" => '\u{e60b}', //  "jsx" => '\u{e7ba}', //  From 98a4431d6aed9a709f281d35b066b78dd286aec9 Mon Sep 17 00:00:00 2001 From: ewreurei <97365039+ewrenge@users.noreply.github.com> Date: Fri, 1 Apr 2022 22:26:51 +0900 Subject: [PATCH 23/24] Fix just command's unavailable option --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3f654f7..71144fc 100644 --- a/README.md +++ b/README.md @@ -215,7 +215,7 @@ Once Rust is installed, you can compile exa with Cargo: cargo test - The [just](https://github.com/casey/just) command runner can be used to run some helpful development commands, in a manner similar to `make`. -Run `just --tasks` to get an overview of what’s available. +Run `just --list` to get an overview of what’s available. - If you are compiling a copy for yourself, be sure to run `cargo build --release` or `just build-release` to benefit from release-mode optimisations. Copy the resulting binary, which will be in the `target/release` directory, into a folder in your `$PATH`. From 6197006d5f8819f270de54b91764ce0fa6e6b28e Mon Sep 17 00:00:00 2001 From: Ryooooooga Date: Sat, 23 Apr 2022 10:18:42 +0900 Subject: [PATCH 24/24] add Go module icons --- src/output/icons.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/output/icons.rs b/src/output/icons.rs index a2bc1ad..30ffdfc 100644 --- a/src/output/icons.rs +++ b/src/output/icons.rs @@ -69,6 +69,8 @@ lazy_static! { m.insert("Dockerfile", '\u{f308}'); //  m.insert("ds_store", '\u{f179}'); //  m.insert("gitignore_global", '\u{f1d3}'); //  + m.insert("go.mod", '\u{e626}'); //  + m.insert("go.sum", '\u{e626}'); //  m.insert("gradle", '\u{e256}'); //  m.insert("gruntfile.coffee", '\u{e611}'); //  m.insert("gruntfile.js", '\u{e611}'); // 