use std::path::PathBuf;
use clap::Subcommand;
use nestify::nest;
nest! {
#[derive(clap::Args, Debug, Clone)]
pub struct ImportCommand {
#[command(subcommand)]
pub import_type: #[derive(Subcommand, Debug, Clone)] pub enum ImportType {
Postman(PostmanImport),
Curl(CurlImport)
},
}
}
#[derive(clap::Args, Debug, Clone)]
pub struct PostmanImport {
#[clap(value_hint = clap::ValueHint::FilePath)]
pub import_path: PathBuf,
#[arg(long)]
pub max_depth: Option<u16>,
}
#[derive(clap::Args, Debug, Clone)]
pub struct CurlImport {
#[clap(value_hint = clap::ValueHint::AnyPath)]
pub import_path: PathBuf,
pub collection_name: String,
pub request_name: Option<String>,
#[arg(short, long, conflicts_with = "request_name")]
pub recursive: bool,
#[arg(long, requires = "recursive", conflicts_with = "request_name")]
pub max_depth: Option<u16>,
}