Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
5e88ffdbc9
commit
b01543a8b9
@ -1,4 +0,0 @@
|
|||||||
mod plan;
|
|
||||||
mod project;
|
|
||||||
mod schema_validator;
|
|
||||||
mod state;
|
|
@ -1,5 +1,5 @@
|
|||||||
use cuddle_state::Cuddle;
|
use cuddle_state::Cuddle;
|
||||||
use state::{validated_project::Project, ValidatedState};
|
use state::ValidatedState;
|
||||||
|
|
||||||
mod cuddle_state;
|
mod cuddle_state;
|
||||||
mod plan;
|
mod plan;
|
||||||
@ -37,7 +37,7 @@ impl Cli {
|
|||||||
Self { cli, cuddle }
|
Self { cli, cuddle }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn setup(mut self) -> anyhow::Result<Self> {
|
pub async fn setup(self) -> anyhow::Result<Self> {
|
||||||
let s = self
|
let s = self
|
||||||
.add_default()
|
.add_default()
|
||||||
.await?
|
.await?
|
||||||
@ -52,16 +52,17 @@ impl Cli {
|
|||||||
Ok(s)
|
Ok(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn execute(mut self) -> anyhow::Result<()> {
|
pub async fn execute(self) -> anyhow::Result<()> {
|
||||||
match self
|
match self
|
||||||
.cli
|
.cli
|
||||||
.get_matches_from(std::env::args())
|
.get_matches_from(std::env::args())
|
||||||
.subcommand()
|
.subcommand()
|
||||||
.ok_or(anyhow::anyhow!("failed to find subcommand"))?
|
.ok_or(anyhow::anyhow!("failed to find subcommand"))?
|
||||||
{
|
{
|
||||||
("do", args) => {
|
("do", _args) => {
|
||||||
tracing::debug!("executing do");
|
tracing::debug!("executing do");
|
||||||
}
|
}
|
||||||
|
("get", _args) => {}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +78,7 @@ impl Cli {
|
|||||||
Ok(self)
|
Ok(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn add_project_commands(mut self) -> anyhow::Result<Self> {
|
async fn add_project_commands(self) -> anyhow::Result<Self> {
|
||||||
if let Some(project) = self.cuddle.state.project.as_ref() {
|
if let Some(project) = self.cuddle.state.project.as_ref() {
|
||||||
// Add project level commands
|
// Add project level commands
|
||||||
}
|
}
|
||||||
@ -85,7 +86,7 @@ impl Cli {
|
|||||||
Ok(self)
|
Ok(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn add_plan_commands(mut self) -> anyhow::Result<Self> {
|
async fn add_plan_commands(self) -> anyhow::Result<Self> {
|
||||||
if let Some(plan) = self.cuddle.state.plan.as_ref() {
|
if let Some(plan) = self.cuddle.state.plan.as_ref() {
|
||||||
// Add plan level commands
|
// Add plan level commands
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user