Debian Bug#1014621: tree: --timefmt doesn't imply -D, manual says it should

Hello there,

the following item had originally been filed via mail to the Debian Bug Tracking System (BTS) at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1014621 and then forwarded to ice+tree@mama.indstate.edu.

Now forwarding it here as well for reference.

The issue that наб illustrates seems to stem from the early "break" when parsing "--timefmt" with a "=" separator (line 428 as of tree 2.0.2). When calling tree without the "=", e.g. "tree --timefmt %s aac/a", it works as expected. @наб, JFYI, and with thanks for the report.

One could argue that tree works just as the manpage describes, as there is no mention of the "=" separator therein, but that would IMHO be rather nitpicky and distracting, and tree would still violate the principle of least surprise in this. ;-)

Best regards, Flo

----- Forwarded message from наб <nabijaczleweli@nabijaczleweli.xyz> -----

Date: Sat, 9 Jul 2022 02:48:43 +0200
From: наб <nabijaczleweli@nabijaczleweli.xyz>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Bug#1014621: tree: --timefmt doesn't imply -D, manual says it should
Reply-To: наб <nabijaczleweli@nabijaczleweli.xyz>, 1014621@bugs.debian.org
Message-ID: <20220709004843.khw7z5ivib3qqimb@tarta.nabijaczleweli.xyz>
User-Agent: NeoMutt/20220429

Package: tree
Version: 2.0.2-1
Version: 1.8.0-1+b1
Severity: normal

Dear Maintainer,

Quoth tree(1):
       --timefmt format
              Prints (implies -D) and formats the date according to the format string which uses the strftime(3) syntax.

However:
-- >8 --
nabijaczleweli@tarta:~/code/voreutils$ tree --timefmt=%s aac/a
aac/a
└── b
    ├── c
    │   └── d
    │       └── e
    └── q

4 directories, 1 file
nabijaczleweli@tarta:~/code/voreutils$ tree --timefmt=%s aac/a -D
aac/a
└── [1631887206]  b
    ├── [1631887206]  c
    │   └── [1631887206]  d
    │       └── [1631887206]  e
    └── [1631885430]  q

4 directories, 1 file
-- >8 --

(Also, the -D in the quoted paragraph is unbolded but should be.)

Affects bullseye (1.8.0-1+b1) and sid (2.0.2-1).

Best,
наб


-- System Information:
Debian Release: 11.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-15-amd64 (SMP w/24 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_FIRMWARE_WORKAROUND, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages tree depends on:
ii  libc6  2.31-13+deb11u3

tree recommends no packages.

tree suggests no packages.

-- no debconf information



----- End forwarded message -----