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

25 lines
786 B
Rust
Raw Normal View History

2022-12-17 21:51:41 +01:00
use util::Cmd;
mod prereqs;
fn main() -> eyre::Result<()> {
let matches = clap::Command::new("toolkit")
2022-12-17 22:56:07 +01:00
.subcommands([
prereqs::prereqs()?,
tldr::Tldr::cmd()?,
sourcegraph::Sourcegraph::cmd()?,
2022-12-17 23:27:41 +01:00
github::GitHub::cmd()?,
2022-12-18 14:47:28 +01:00
stats::Stats::cmd()?,
2022-12-17 22:56:07 +01:00
])
2022-12-17 21:51:41 +01:00
.get_matches();
match matches.subcommand() {
2022-12-18 14:47:28 +01:00
Some(("prereqs", subcmd)) => prereqs::prereqs_exec(subcmd),
2022-12-17 21:51:41 +01:00
Some(("tldr", subcmd)) => tldr::Tldr::exec(subcmd),
2022-12-17 22:56:07 +01:00
Some(("sourcegraph", subcmd)) => sourcegraph::Sourcegraph::exec(subcmd),
2022-12-17 23:27:41 +01:00
Some(("github", subcmd)) => github::GitHub::exec(subcmd),
2022-12-18 14:47:28 +01:00
Some(("stats", subcmd)) => stats::Stats::exec(subcmd),
2022-12-17 21:51:41 +01:00
_ => Err(eyre::anyhow!("no command selected!")),
}
}