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.
toolkit/src/main.rs
2022-12-18 14:47:28 +01:00

25 lines
786 B
Rust

use util::Cmd;
mod prereqs;
fn main() -> eyre::Result<()> {
let matches = clap::Command::new("toolkit")
.subcommands([
prereqs::prereqs()?,
tldr::Tldr::cmd()?,
sourcegraph::Sourcegraph::cmd()?,
github::GitHub::cmd()?,
stats::Stats::cmd()?,
])
.get_matches();
match matches.subcommand() {
Some(("prereqs", subcmd)) => prereqs::prereqs_exec(subcmd),
Some(("tldr", subcmd)) => tldr::Tldr::exec(subcmd),
Some(("sourcegraph", subcmd)) => sourcegraph::Sourcegraph::exec(subcmd),
Some(("github", subcmd)) => github::GitHub::exec(subcmd),
Some(("stats", subcmd)) => stats::Stats::exec(subcmd),
_ => Err(eyre::anyhow!("no command selected!")),
}
}