agent: add --version / -V flag
This commit is contained in:
parent
155c420a1a
commit
5b8ec7efc1
@ -37,6 +37,12 @@ fn arg_value(name: &str) -> Option<String> {
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
tracing_subscriber::fmt::init();
|
||||
|
||||
// Version flag (print and exit). Keep before heavy initialization.
|
||||
if arg_flag("--version") || arg_flag("-V") {
|
||||
println!("socktop_agent {}", env!("CARGO_PKG_VERSION"));
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let state = AppState::new();
|
||||
|
||||
// Start background sampler (adjust cadence as needed)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user