use std::path::PathBuf;
use clap::{Args, Parser, Subcommand};
use crate::runtime::DEFAULT_MGMT_PORT;
#[derive(Debug, Parser)]
#[command(author, version, about, long_about = None)]
pub struct Opts {
#[command(subcommand)]
pub command: Commands,
#[command(flatten)]
pub logging: LoggingOptions,
#[command(flatten)]
pub management: ManagementOptions,
}
#[derive(Debug, Args)]
pub struct ManagementOptions {
#[arg(long, global = true, default_value_t = DEFAULT_MGMT_PORT)]
pub mgmt_port: u16,
}
#[derive(Debug, Args)]
pub struct LoggingOptions {
#[arg(long, global = true, default_value = "true")]
#[clap(global = true)]
pub stderr: bool,
#[arg(long, global = true)]
pub log_dir: Option<PathBuf>,
}
#[derive(Debug, Subcommand)]
pub enum Commands {
Run {
#[arg(long)]
state_file: Option<PathBuf>,
#[arg(long)]
io_config_file: Option<PathBuf>,
#[arg(long)]
start_time_sec: Option<u64>,
#[arg(long, hide = true)]
start_time_subsec: Option<u32>,
},
}