sui_cluster_test/
config.rsuse clap::*;
use regex::Regex;
use std::path::PathBuf;
#[derive(Parser, Clone, ValueEnum, Debug)]
pub enum Env {
Devnet,
Staging,
Ci,
CiNomad,
Testnet,
CustomRemote,
NewLocal,
}
#[derive(derive_more::Debug, Parser)]
#[clap(name = "", rename_all = "kebab-case")]
pub struct ClusterTestOpt {
#[clap(value_enum)]
pub env: Env,
#[clap(long)]
pub faucet_address: Option<String>,
#[clap(long)]
pub fullnode_address: Option<String>,
#[clap(long)]
pub epoch_duration_ms: Option<u64>,
#[clap(long)]
pub indexer_address: Option<String>,
#[clap(long)]
#[debug("{}", match pg_address {
None => "None".into(),
Some(val) => Regex::new(r":.*@")
.unwrap()
.replace_all(val.as_str(), ":*****@"),
})]
pub pg_address: Option<String>,
#[clap(long)]
pub config_dir: Option<PathBuf>,
#[clap(long)]
pub graphql_address: Option<String>,
#[clap(long)]
pub with_indexer_and_graphql: bool,
}
impl ClusterTestOpt {
pub fn new_local() -> Self {
Self {
env: Env::NewLocal,
faucet_address: None,
fullnode_address: None,
epoch_duration_ms: None,
indexer_address: None,
pg_address: None,
config_dir: None,
graphql_address: None,
with_indexer_and_graphql: false,
}
}
}