with network stats
This commit is contained in:
28
crates/stats/src/lib.rs
Normal file
28
crates/stats/src/lib.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
mod code;
|
||||
mod network;
|
||||
|
||||
pub struct Stats;
|
||||
|
||||
impl Stats {
|
||||
fn run() -> eyre::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl util::Cmd for Stats {
|
||||
fn cmd() -> eyre::Result<clap::Command> {
|
||||
let cmd = clap::Command::new("stats")
|
||||
.subcommands(&[code::Code::cmd()?, network::Network::cmd()?])
|
||||
.subcommand_required(true);
|
||||
|
||||
Ok(cmd)
|
||||
}
|
||||
|
||||
fn exec(args: &clap::ArgMatches) -> eyre::Result<()> {
|
||||
match args.subcommand() {
|
||||
Some(("code", args)) => code::Code::exec(args),
|
||||
Some(("network", args)) => network::Network::exec(args),
|
||||
_ => Stats::run(),
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user