feat(irtt-cli): add optional tui output mode

This commit is contained in:
Nils Andreas Svee committed 2026-06-09 13:29:00 +07:00
1 parent ece9fd6db0
commit c31ad07d61
6 files changed
+2210 -6

No files matched your search

+6 -1
View File
@@ -89,7 +89,7 @@ pub struct CliArgs {
#[arg(long)]
pub loose: bool,
/// Output format: human, simple, machine, or rtt-us.
/// Output format.
#[arg(long, value_enum, default_value_t = OutputMode::Human)]
pub output: OutputMode,
@@ -201,6 +201,9 @@ pub enum OutputMode {
Simple,
/// RTT microseconds only.
RttUs,
/// TUI dashboard with live cumulative statistics.
#[cfg(feature = "tui")]
Tui,
}
impl OutputMode {
@@ -320,6 +323,8 @@ pub fn format_event(event: &ClientEvent, mode: OutputMode) -> Option<String> {
OutputMode::Human => Some(format_human_event(event, None)),
OutputMode::Machine => Some(format_machine(event)),
OutputMode::Simple => Some(format_simple(event)),
#[cfg(feature = "tui")]
OutputMode::Tui => None,
}
}