diff --git a/src/args.rs b/src/args.rs index ad261bf..e1b0b4a 100644 --- a/src/args.rs +++ b/src/args.rs @@ -7,6 +7,7 @@ pub const VERSION: &str = concat!(env!("CARGO_PKG_VERSION"), " (", env!("VERGEN_ pub struct ServerCommand { /// Path to the repo's tablejohn database. pub db: PathBuf, + // TODO Make repo optional /// Path to the git repo. pub repo: PathBuf, } @@ -14,6 +15,7 @@ pub struct ServerCommand { #[derive(Debug, clap::Parser)] pub enum Command { Server(ServerCommand), + Runner, } #[derive(Debug, clap::Parser)] diff --git a/src/main.rs b/src/main.rs index cbb1e06..a1dd947 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ mod args; mod config; +mod runner; mod server; mod somehow; @@ -16,6 +17,7 @@ use tracing_subscriber::{ use crate::{ args::{Args, Command, NAME, VERSION}, config::Config, + runner::Runner, server::Server, }; @@ -121,6 +123,14 @@ async fn run() -> somehow::Result<()> { _ = server.shut_down() => {} } } + Command::Runner => { + let runner = Runner::new(); + + select! { + _ = wait_for_signal() => {} + _ = runner.run() => {} + } + } } Ok(()) diff --git a/src/runner.rs b/src/runner.rs new file mode 100644 index 0000000..e30c2a0 --- /dev/null +++ b/src/runner.rs @@ -0,0 +1,13 @@ +use tracing::error; + +pub struct Runner {} + +impl Runner { + pub fn new() -> Self { + Self {} + } + + pub async fn run(&self) { + error!("Runner not yet implemented"); + } +}