From 7dc792491570e223118b51b087e8725f6cbc45cd Mon Sep 17 00:00:00 2001 From: Fuad Ismail <fuad1502@gmail.com> Date: Sun, 24 Nov 2024 23:13:51 +0700 Subject: [PATCH] dmesg: add time-format command arg. --- src/uu/dmesg/src/dmesg.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/uu/dmesg/src/dmesg.rs b/src/uu/dmesg/src/dmesg.rs index 8fb64f7..0e590cc 100644 --- a/src/uu/dmesg/src/dmesg.rs +++ b/src/uu/dmesg/src/dmesg.rs @@ -49,11 +49,21 @@ pub fn uu_app() -> Command { .help("use JSON output format") .action(ArgAction::SetTrue), ) + .arg( + Arg::new(options::TIME_FORMAT) + .long("time-format") + .help( + "show timestamp using the given format:\n".to_string() + + " [delta|reltime|ctime|notime|iso|raw]", + ) + .action(ArgAction::Set), + ) } mod options { pub const KMSG_FILE: &str = "kmsg-file"; pub const JSON: &str = "json"; + pub const TIME_FORMAT: &str = "time-format"; } struct Dmesg<'a> {