add releaser

This commit is contained in:
2022-12-18 20:05:49 +01:00
parent bd52a2d3bb
commit 98cb397ea9
8 changed files with 174 additions and 4 deletions

13
src/init/fish.rs Normal file
View File

@@ -0,0 +1,13 @@
pub struct Fish;
impl util::Cmd for Fish {
fn cmd() -> eyre::Result<clap::Command> {
let cmd = clap::Command::new("fish").subcommands(&[]);
Ok(cmd)
}
fn exec(args: &clap::ArgMatches) -> eyre::Result<()> {
Ok(())
}
}

20
src/init/mod.rs Normal file
View File

@@ -0,0 +1,20 @@
mod fish;
pub struct Init;
impl util::Cmd for Init {
fn cmd() -> eyre::Result<clap::Command> {
let cmd = clap::Command::new("init")
.subcommands(&[fish::Fish::cmd()?])
.subcommand_required(true);
Ok(cmd)
}
fn exec(args: &clap::ArgMatches) -> eyre::Result<()> {
match args.subcommand() {
Some(("fish", args)) => fish::Fish::exec(args),
_ => Err(eyre::anyhow!("missing command!")),
}
}
}

View File

@@ -1,5 +1,6 @@
use util::Cmd;
mod init;
mod prereqs;
fn main() -> eyre::Result<()> {
@@ -10,7 +11,9 @@ fn main() -> eyre::Result<()> {
sourcegraph::Sourcegraph::cmd()?,
github::GitHub::cmd()?,
stats::Stats::cmd()?,
init::Init::cmd()?,
])
.subcommand_required(true)
.get_matches();
match matches.subcommand() {
@@ -19,6 +22,7 @@ fn main() -> eyre::Result<()> {
Some(("sourcegraph", subcmd)) => sourcegraph::Sourcegraph::exec(subcmd),
Some(("github", subcmd)) => github::GitHub::exec(subcmd),
Some(("stats", subcmd)) => stats::Stats::exec(subcmd),
Some(("init", subcmd)) => init::Init::exec(subcmd),
_ => Err(eyre::anyhow!("no command selected!")),
}
}