add releaser
This commit is contained in:
13
src/init/fish.rs
Normal file
13
src/init/fish.rs
Normal 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
20
src/init/mod.rs
Normal 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!")),
|
||||
}
|
||||
}
|
||||
}
|
@@ -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!")),
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user