dkl cg ls: more cols + customizable list

This commit is contained in:
Mikaël Cluseau
2026-04-14 09:20:05 +02:00
parent dc936f52ab
commit c19798f9f0
2 changed files with 32 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
use clap::{CommandFactory, Parser, Subcommand};
use eyre::{Result, format_err};
use eyre::{format_err, Result};
use human_units::Duration;
use log::{debug, error};
use std::net::SocketAddr;
@@ -99,6 +99,8 @@ enum CgCmd {
root: Option<PathBuf>,
#[arg(long, short = 'X')]
exclude: Vec<String>,
#[arg(long, short = 'C')]
cols: Option<String>,
},
}
@@ -179,7 +181,11 @@ async fn main() -> Result<()> {
.map(|_| ())?),
C::Cg { cmd } => match cmd {
CgCmd::Ls { root, exclude } => Ok(dkl::cgroup::ls(root, &exclude).await?),
CgCmd::Ls {
root,
exclude,
cols,
} => Ok(dkl::cgroup::ls(root, &exclude, cols.as_deref()).await?),
},
}
}