Skip to content

Commit 6bfb621

Browse files
committed
🐛 Fixed dir_trailing_slash in bsdtar list format
1 parent d24c986 commit 6bfb621

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

cli/src/command/list.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,7 @@ fn list_archive(ctx: &crate::cli::GlobalContext, args: ListCommand) -> anyhow::R
519519
numeric_owner: args.numeric_owner,
520520
hide_control_chars: args.hide_control_chars,
521521
classify: args.classify,
522+
dir_trailing_slash: false,
522523
format: args.format,
523524
out_to_stderr: false,
524525
color: ctx.color(),
@@ -615,6 +616,7 @@ pub(crate) struct ListOptions {
615616
pub(crate) numeric_owner: bool,
616617
pub(crate) hide_control_chars: bool,
617618
pub(crate) classify: bool,
619+
pub(crate) dir_trailing_slash: bool,
618620
pub(crate) format: Option<Format>,
619621
pub(crate) out_to_stderr: bool,
620622
pub(crate) color: ColorChoice,
@@ -843,7 +845,11 @@ impl<'a> Display for SimpleListDisplay<'a> {
843845
Display::fmt(name, f)
844846
}?;
845847
match &path.entry_type {
846-
EntryType::Directory(_) if self.options.classify => f.write_char('/')?,
848+
EntryType::Directory(_)
849+
if self.options.dir_trailing_slash || self.options.classify =>
850+
{
851+
f.write_char('/')?
852+
}
847853
EntryType::SymbolicLink(_, _) if self.options.classify => f.write_char('@')?,
848854
_ => (),
849855
};

cli/src/command/stdio.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,8 @@ fn run_list_archive(args: StdioCommand) -> anyhow::Result<()> {
11721172
time_field: TimeField::default(),
11731173
numeric_owner: args.numeric_owner,
11741174
hide_control_chars: false,
1175-
classify: true,
1175+
classify: false,
1176+
dir_trailing_slash: true,
11761177
format: Some(if args.verbose {
11771178
Format::BsdTar
11781179
} else {

0 commit comments

Comments
 (0)