From cc183fccca73df619c78dd0ca2567ac547c56ad2 Mon Sep 17 00:00:00 2001 From: seth Date: Sun, 8 Sep 2024 23:39:48 -0400 Subject: feat: initial commit --- src/main.rs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/main.rs (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..6d3fe4d --- /dev/null +++ b/src/main.rs @@ -0,0 +1,34 @@ +#![allow(clippy::multiple_crate_versions)] +use anyhow::Result; +use clap::Parser; +use reqwest::StatusCode; +use tracing::instrument; + +mod cli; +mod command; +mod http; +mod nix; + +use cli::Cli; +use command::Run; + +#[derive(Clone, Debug, thiserror::Error)] +enum Error { + #[error("Unstable to complete HTTP request: {0}")] + HTTPFailed(StatusCode), + #[error("Nix exited with code {code}: {stderr}")] + Nix { code: i32, stderr: String }, +} + +#[tokio::main] +#[instrument] +async fn main() -> Result<()> { + tracing_subscriber::fmt::init(); + + let cli = Cli::parse(); + if let Err(why) = cli.run().await { + eprintln!("{why}"); + } + + Ok(()) +} -- cgit v1.2.3