feat: add initial

This commit is contained in:
2025-07-07 19:48:37 +02:00
commit e10a40dc6b
9 changed files with 811 additions and 0 deletions

1
crates/norun/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/target

11
crates/norun/Cargo.toml Normal file
View File

@@ -0,0 +1,11 @@
[package]
name = "norun"
version = "0.1.0"
edition = "2024"
[dependencies]
anyhow = "1.0.98"
clap = { version = "4.5.40", features = ["derive", "env"] }
tokio = { version = "1.46.1", features = ["full"] }
tracing = { version = "0.1.41", features = ["log"] }
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }

29
crates/norun/src/cli.rs Normal file
View File

@@ -0,0 +1,29 @@
use clap::{Parser, Subcommand};
use crate::cli::publish::PublishCommand;
mod publish;
#[derive(Parser)]
#[command(author, version, about)]
struct Cli {
#[command(subcommand)]
subcommands: CliSubcommands,
}
#[derive(Subcommand)]
enum CliSubcommands {
Publish(PublishCommand),
}
pub async fn execute() -> anyhow::Result<()> {
let cmd = Cli::parse();
let state = State::new();
match cmd.subcommands {
CliSubcommands::Publish(cmd) => cmd.execute(&state),
}
Ok(())
}

View File

@@ -0,0 +1,8 @@
#[derive(clap::Parser)]
pub struct PublishCommand {}
impl PublishCommand {
pub async fn execute(&self, state: &State) -> anyhow::Result<()> {
Ok(())
}
}

20
crates/norun/src/main.rs Normal file
View File

@@ -0,0 +1,20 @@
use tracing_subscriber::EnvFilter;
mod cli;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
tracing_subscriber::fmt()
.with_env_filter(
EnvFilter::from_default_env()
.add_directive("norun=trace".parse().unwrap())
.add_directive("info".parse().unwrap()),
)
.init();
tracing::info!("starting norun application");
cli::execute().await?;
Ok(())
}