From af4f8c0a130ab30f6f8fecbb410105e2d9a67c0d Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:02:16 +0000 Subject: [PATCH] wip --- src/cli/daemon/mod.rs | 3 +++ src/cli/daemon/status.rs | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 src/cli/daemon/status.rs diff --git a/src/cli/daemon/mod.rs b/src/cli/daemon/mod.rs index f03fa18..1a9a16d 100644 --- a/src/cli/daemon/mod.rs +++ b/src/cli/daemon/mod.rs @@ -2,6 +2,7 @@ use crate::{procs, Result}; mod run; mod start; +mod status; mod stop; #[derive(Debug, clap::Args)] @@ -14,6 +15,7 @@ pub struct Daemon { enum Commands { Run(run::Run), Start(start::Start), + Status(status::Status), Stop(stop::Stop), } @@ -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, } } diff --git a/src/cli/daemon/status.rs b/src/cli/daemon/status.rs new file mode 100644 index 0000000..95524da --- /dev/null +++ b/src/cli/daemon/status.rs @@ -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(()) + } +}