mod effects;
mod init;
mod login;
mod logout;
mod sim;
mod systems;
pub mod util;
use anyhow::Result;
use clap::{Parser, Subcommand};
#[derive(Debug, Parser)]
#[command(name = "rngo")]
#[command(
about = "Data simulation CLI. See https://rngo.dev/docs/cli.",
long_about = None
)]
struct Cli {
#[command(subcommand)]
command: Commands,
}
#[derive(Debug, Subcommand)]
enum Commands {
Init {},
Login {},
Logout {},
Effects {
#[command(subcommand)]
command: EffectsCommands,
},
Systems {
#[command(subcommand)]
command: SystemsCommands,
},
Sim {
#[arg(short, long)]
spec: Option<String>,
#[arg(long)]
stdout: bool,
},
}
#[derive(Debug, Subcommand)]
enum EffectsCommands {
Infer {
#[arg(long)]
prompt: bool,
#[arg(short, long)]
verbose: bool,
},
}
#[derive(Debug, Subcommand)]
enum SystemsCommands {
Infer {
#[arg(long)]
prompt: bool,
#[arg(short, long)]
verbose: bool,
},
}
#[tokio::main]
async fn main() -> Result<()> {
let args = Cli::parse();
match args.command {
Commands::Init {} => init::init().await,
Commands::Login {} => login::login().await,
Commands::Logout {} => logout::logout().await,
Commands::Effects { command } => match command {
EffectsCommands::Infer { prompt, verbose } => {
effects::infer_effects(prompt, verbose).await
}
},
Commands::Systems { command } => match command {
SystemsCommands::Infer { prompt, verbose } => {
systems::infer_systems(prompt, verbose).await
}
},
Commands::Sim { spec, stdout } => sim::sim(spec, stdout).await,
}
}