eza-community / eza

A modern alternative to ls
https://eza.rocks
European Union Public License 1.2
12.5k stars 220 forks source link

bug: panic on invalid time-style format #1240

Open xitep opened 6 days ago

xitep commented 6 days ago
> eza --version
eza - A modern, maintained replacement for ls
v0.20.8 [+git]
https://github.com/eza-community/eza

# terminal
> foot --version
foot version: 1.18.1 +pgo +ime +graphemes -assertions

# shell
> fish --version
fish, version 3.7.1

# os
> lsb_release -a
LSB Version:    n/a
Distributor ID: ManjaroLinux
Description:    Manjaro Linux
Release:    24.1.2
Codename:   Xahea

# now ... reproduce the panic
> eza -l --time-style '+%'
thread '<unnamed>' panicked at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/alloc/src/string.rs:2566:14:
a Display implementation returned an error unexpectedly: Error
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fish: Job 1, 'eza -l --time-style '+%'' terminated by signal SIGABRT (Abort)

i think an error message instead of a panic, akin to eza -l --time-style invalid for example, would be more appropriate.