Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ yanked = "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",
# time v0.3.44 stack overflow in format description parsing (via plist).
# Cannot upgrade to >=0.3.47 because it requires Rust 1.88 (edition 2024),
# which is above the current MSRV (1.83). Low risk for eza since time
# parsing input is not user-controlled. Will be resolved when MSRV is bumped.
"RUSTSEC-2026-0009",
]
# Threshold for security vulnerabilities, any vulnerability with a CVSS score
# lower than the range specified will be ignored. Note that ignored advisories
Expand Down
16 changes: 6 additions & 10 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use std::env;
use std::ffi::{OsStr, OsString};
use std::io::{self, ErrorKind, IsTerminal, Read, Write, stdin};
use std::path::{Component, PathBuf};
use std::path::PathBuf;
use std::process::exit;

use nu_ansi_term::{AnsiStrings as ANSIStrings, Style};
Expand Down Expand Up @@ -266,7 +266,7 @@ impl Exa<'_> {
self.options.filter.filter_argument_files(&mut files);
self.print_files(None, files)?;

self.print_dirs(dirs, no_files, is_only_dir, exit_status)
self.print_dirs(dirs, no_files, is_only_dir, exit_status, 0)
}

fn print_dirs(
Expand All @@ -275,6 +275,7 @@ impl Exa<'_> {
mut first: bool,
is_only_dir: bool,
exit_status: i32,
depth: usize,
) -> io::Result<i32> {
let View {
file_style: file_name::Options { quote_style, .. },
Expand Down Expand Up @@ -340,14 +341,9 @@ impl Exa<'_> {
self.options.filter.sort_files(&mut children);

if let Some(recurse_opts) = self.options.dir_action.recurse_options() {
let depth = dir
.path
.components()
.filter(|&c| c != Component::CurDir)
.count()
+ 1;
let child_depth = depth + 1;
let follow_links = self.options.view.follow_links;
if !recurse_opts.tree && !recurse_opts.is_too_deep(depth) {
if !recurse_opts.tree && !recurse_opts.is_too_deep(child_depth) {
let child_dirs = children
.iter()
.filter(|f| {
Expand All @@ -361,7 +357,7 @@ impl Exa<'_> {
.collect::<Vec<Dir>>();

self.print_files(Some(dir), children)?;
match self.print_dirs(child_dirs, false, false, exit_status) {
match self.print_dirs(child_dirs, false, false, exit_status, child_depth) {
Ok(_) => (),
Err(e) => return Err(e),
}
Expand Down
Empty file.
31 changes: 31 additions & 0 deletions tests/cmd/recurse_level_with_path_unix.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
a
b
c
d
dir-symlink -> vagrant/debug
e
exa
f
g
h
i
image.jpg.img.c.rs.log.png
index.svg
j
k
l
m
n
o
p
q
vagrant

tests/itest/exa:
file.c -> djihisudjuhfius
sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

tests/itest/vagrant:
debug
dev
log
2 changes: 2 additions & 0 deletions tests/cmd/recurse_level_with_path_unix.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bin.name = "eza"
args = "-R --level=2 tests/itest"
2 changes: 1 addition & 1 deletion tests/gen/long_recurse_with_level_unix.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
bin.name = "eza"
args = "tests/test_dir --long --no-user --no-permissions --no-time --no-filesize --recurse --level 2"
args = "tests/test_dir --long --no-user --no-permissions --no-time --no-filesize --recurse --level 1"
Loading