v1 implemented

it compiles
This commit is contained in:
2026-02-19 01:19:05 +00:00
commit 211cf6b017
10 changed files with 1498 additions and 0 deletions

16
src/config.rs Normal file
View File

@@ -0,0 +1,16 @@
use clap::Parser;
use std::time::Duration;
#[derive(Debug, Clone, Parser)]
#[command(name = "sloptop", about = "A lightweight TUI resource monitor")]
pub struct Config {
/// Polling interval in milliseconds
#[arg(short, long, default_value_t = 1000, value_parser = clap::value_parser!(u64).range(200..=5000))]
pub interval_ms: u64,
}
impl Config {
pub fn refresh_interval(&self) -> Duration {
Duration::from_millis(self.interval_ms)
}
}