use std::path::PathBuf;
use clap::{Args, Parser};
use serde::{Deserialize, Serialize};
#[derive(Debug, Parser, Clone, Serialize, Deserialize)]
#[command(author, version, about, long_about = None)]
pub(crate) struct Cli {
#[command(flatten)]
pub(crate) pg_opts: Pg,
#[arg(short, long)]
pub(crate) include_tables: Option<Vec<String>>,
#[arg(short, long)]
pub(crate) exclude_tables: Option<Vec<String>>,
#[arg(short, long)]
pub(crate) title: Option<String>,
#[arg(long)]
pub(crate) column_description_wrap: Option<usize>,
#[arg(long)]
pub(crate) table_description_wrap: Option<usize>,
#[arg(long)]
pub(crate) comments: bool,
pub(crate) template: Option<PathBuf>,
pub(crate) output: Option<PathBuf>,
}
#[derive(Debug, Args, Clone, Serialize, Deserialize)]
pub(crate) struct Pg {
#[arg(short, long, default_value = "localhost")]
pub(crate) hostname: String,
#[arg(short, long, default_value = "postgres")]
pub(crate) username: String,
#[arg(short, long, default_value = "postgres")]
pub(crate) password: String,
#[arg(short, long, default_value = "postgres")]
pub(crate) database: String,
#[arg(short, long, default_value = "public")]
pub(crate) schema: String,
}
pub(crate) fn load() -> Cli {
Cli::parse()
}