use clap::builder::TypedValueParser;
use clap::{Args, ValueHint};
use std::path::PathBuf;
#[derive(Args, Debug)]
pub struct RSourceArgs {
#[arg(short, long, value_hint = ValueHint::FilePath)]
pub config: Option<PathBuf>,
#[arg(
long = "r-home",
value_hint = ValueHint::DirPath,
env = "ARF_R_HOME",
conflicts_with = "r_version"
)]
pub r_home: Option<PathBuf>,
#[arg(
long = "with-r-version",
env = "ARF_R_VERSION",
conflicts_with = "r_home"
)]
pub r_version: Option<String>,
#[arg(long = "no-r-source-overrides")]
pub no_r_source_overrides: bool,
#[arg(long = "no-r-auto-discovery", hide = true)]
pub no_r_auto_discovery: bool,
}
#[derive(Args, Debug)]
pub struct RCompatArgs {
#[arg(long = "vanilla")]
pub vanilla: bool,
#[arg(long = "no-environ", hide_short_help = true)]
pub no_environ: bool,
#[arg(long = "no-site-file", hide_short_help = true)]
pub no_site_file: bool,
#[arg(long = "no-init-file", hide_short_help = true)]
pub no_init_file: bool,
#[arg(long = "max-connections", hide = true)]
pub max_connections: Option<u32>,
#[arg(long = "max-ppsize", hide = true)]
pub max_ppsize: Option<u32>,
#[arg(long = "min-nsize", hide = true)]
pub min_nsize: Option<String>,
#[arg(long = "min-vsize", hide = true)]
pub min_vsize: Option<String>,
}
#[derive(Args, Debug)]
pub struct HistoryOptions {
#[arg(
long = "history-dir",
value_hint = ValueHint::DirPath,
env = "ARF_HISTORY_DIR",
hide_short_help = true,
value_parser = clap::builder::NonEmptyStringValueParser::new().map(PathBuf::from),
)]
pub history_dir: Option<PathBuf>,
#[arg(long = "no-history", hide_short_help = true)]
pub no_history: bool,
}