use clap::{Args, Parser, Subcommand};
#[derive(Debug, Parser)]
#[command(version, about)]
pub struct Cli {
#[command(subcommand)]
pub command: Command,
}
#[derive(Debug, Subcommand)]
pub enum Command {
Run(RunOptions),
Migrate(MigrateOptions),
}
#[derive(Args, Debug, Clone)]
pub struct RunOptions {
#[arg(short = 'd', long = "db-url", env = "DATABASE_URL")]
pub db_url: String,
#[arg(short = 'c', long = "config-file", env = "CONFIG_FILE")]
pub config_file: String,
#[arg(long, env = "MNEMONIC_FILE", default_value = "./tilt/secrets/mnemonic")]
pub mnemonic_file: String,
#[arg(long, env = "RPC_URL_HTTP", default_value = "http://localhost:8899")]
pub rpc_url_http: String,
#[arg(long, env = "RPC_URL_WS")]
pub rpc_url_ws: Option<String>,
#[arg(long, env = "FTL_URL")]
pub ftl_url: Option<String>,
#[arg(long, env = "LISTEN_ADDRESS", default_value = "0.0.0.0:4000")]
pub listen_address: String,
#[arg(
long,
env = "OTEL_EXPORTER_OTLP_ENDPOINT",
default_value = "http://localhost:4317"
)]
pub otlp_endpoint: String,
#[arg(long, env = "DB_REFRESH_INTERVAL_SECONDS", default_value = "10")]
pub db_refresh_interval_seconds: u64,
}
#[derive(Args, Debug, Clone)]
pub struct MigrateOptions {
#[arg(short = 'd', long = "db-url", env = "DATABASE_URL")]
pub db_url: String,
}