Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Dec 9, 2024
1 parent 38312d4 commit af4f8c0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cli/daemon/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::{procs, Result};

mod run;
mod start;
mod status;
mod stop;

#[derive(Debug, clap::Args)]
Expand All @@ -14,6 +15,7 @@ pub struct Daemon {
enum Commands {
Run(run::Run),
Start(start::Start),
Status(status::Status),
Stop(stop::Stop),
}

Expand All @@ -22,6 +24,7 @@ impl Daemon {
match self.command {
Commands::Run(run) => run.run().await,
Commands::Start(start) => start.run().await,
Commands::Status(status) => status.run().await,
Commands::Stop(stop) => stop.run().await,
}
}
Expand Down
16 changes: 16 additions & 0 deletions src/cli/daemon/status.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use crate::ipc::client::IpcClient;
use crate::pitchfork_toml::PitchforkToml;
use crate::Result;

/// Gets the status of the pitchfork daemon
#[derive(Debug, clap::Args)]
#[clap()]
pub struct Status {}

impl Status {
pub async fn run(&self) -> Result<()> {
IpcClient::connect().await?;
println!("Pitchfork daemon is running");
Ok(())
}
}

0 comments on commit af4f8c0

Please sign in to comment.