mod action;
mod completions;
mod configdir;
mod list;
mod shell;
use action::{ActionContext, ActionResult, CliAction};
use clap::ArgMatches;
pub(crate) fn run(
parent: &ArgMatches,
(subcommand, matches): (&str, Option<&ArgMatches>),
) -> ActionResult {
let context = ActionContext::new(&parent, matches);
let command = match subcommand {
"config-dir" => configdir::Command::dispatch,
"gen-completions" => completions::Command::dispatch,
"list-projects" => list::ProjectsCommand::dispatch,
"list-tags" => list::TagsCommand::dispatch,
"shell" => shell::Command::dispatch,
_ => unimplemented!(),
};
command(context)
}