mirror of
https://github.com/eza-community/eza.git
synced 2025-12-23 05:36:50 +00:00
fix: do not print parent filename with --absolute=on
The parent path of a file was added even with absolute={on,follow}, causing the parent path being prepended to the resolved (absolute) filepath.
Fixes: #1151
This commit is contained in:
parent
feda3299fd
commit
172590380a
4 changed files with 4 additions and 1 deletions
|
|
@ -237,7 +237,7 @@ impl<'a, 'dir, C: Colours> FileName<'a, 'dir, C> {
|
|||
bits.push(style.paint(" ".repeat(spaces_count as usize)));
|
||||
}
|
||||
|
||||
if self.file.parent_dir.is_none() {
|
||||
if self.file.parent_dir.is_none() && self.options.absolute == Absolute::Off {
|
||||
if let Some(parent) = self.file.path.parent() {
|
||||
self.add_parent_bits(&mut bits, parent);
|
||||
}
|
||||
|
|
|
|||
0
tests/cmd/absolute_file_all.stderr
Normal file
0
tests/cmd/absolute_file_all.stderr
Normal file
1
tests/cmd/absolute_file_all.stdout
Normal file
1
tests/cmd/absolute_file_all.stdout
Normal file
|
|
@ -0,0 +1 @@
|
|||
[CWD]/tests/itest/index.svg
|
||||
2
tests/cmd/absolute_file_all.toml
Normal file
2
tests/cmd/absolute_file_all.toml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
bin.name = "eza"
|
||||
args = "tests/itest/index.svg --absolute"
|
||||
Loading…
Add table
Add a link
Reference in a new issue