This repository has been archived on 2023-01-14. You can view files and clone it, but cannot push or open issues or pull requests.

30 lines
665 B
Rust
Raw Normal View History

2022-12-18 15:06:12 +01:00
pub struct Perf;
impl Perf {
fn run() -> eyre::Result<()> {
2022-12-19 09:59:49 +01:00
if let Err(_) = util::shell::run_with_input_and_output(&["btm", "--version"], "".into()) {
2022-12-18 15:06:12 +01:00
return Err(eyre::anyhow!(
2022-12-19 09:59:49 +01:00
"could not find btm, please install or add to PATH"
2022-12-18 15:06:12 +01:00
));
}
2022-12-19 09:59:49 +01:00
util::shell::run(&["btm"], None)?;
2022-12-18 15:06:12 +01:00
Ok(())
}
}
impl util::Cmd for Perf {
fn cmd() -> eyre::Result<clap::Command> {
let cmd = clap::Command::new("perf").subcommands(&[]);
Ok(cmd)
}
fn exec(args: &clap::ArgMatches) -> eyre::Result<()> {
match args.subcommand() {
_ => Perf::run(),
}
}
}