use clap::{crate_authors, crate_version, ColorChoice, Parser, Subcommand};
use prdoclib::{common::PRNumber, title::Title};
use std::path::PathBuf;
#[derive(Parser, Debug)]
#[clap(color=ColorChoice::Auto, disable_version_flag = true, arg_required_else_help = true )]
pub struct Opts {
#[clap(short, long, global = true, display_order = 99)]
pub json: bool,
#[allow(missing_docs)]
#[clap(subcommand)]
pub subcmd: Option<SubCommand>,
#[clap(short, long, alias = "V")]
pub version: bool,
}
#[derive(Subcommand, Debug)]
pub enum SubCommand {
#[allow(missing_docs)]
#[clap(version = crate_version!(), author = crate_authors!())]
Generate(GenOpts),
#[allow(missing_docs)]
#[clap(alias = "validate", version = crate_version!(), author = crate_authors!())]
Check(CheckOpts),
#[allow(missing_docs)]
#[clap(version = crate_version!(), author = crate_authors!())]
Scan(ScanOpts),
#[allow(missing_docs)]
#[clap(version = crate_version!(), author = crate_authors!())]
Load(LoadOpts),
#[allow(missing_docs)]
#[clap(version = crate_version!(), author = crate_authors!())]
Schema(SchemaOpts),
}
#[derive(Parser, Debug)]
pub struct GenOpts {
#[clap(index = 1)]
pub number: PRNumber,
#[clap(short, long)]
pub title: Option<Title>,
#[clap(short, long)]
pub save: bool,
#[clap(short, long, default_value = ".")]
pub output_dir: PathBuf,
}
#[derive(Parser, Debug)]
pub struct CheckOpts {
#[clap(short, long, default_value = ".")]
pub directory: PathBuf,
#[clap(short, long, conflicts_with = "number")]
pub file: Option<PathBuf>,
#[clap(short, long)]
pub number: Option<Vec<PRNumber>>,
#[clap(short, long, conflicts_with_all = ["file", "number"])]
pub list: Option<PathBuf>,
}
#[derive(Parser, Debug)]
pub struct ScanOpts {
#[clap(index = 1, default_value = ".")]
pub directory: PathBuf,
#[clap(short, long)]
pub all: bool,
}
#[derive(Parser, Debug)]
pub struct LoadOpts {
#[clap(short, long, default_value = ".")]
pub directory: PathBuf,
#[clap(short, long, conflicts_with = "number")]
pub file: Option<PathBuf>,
#[clap(short, long)]
pub number: Option<Vec<PRNumber>>,
#[clap(short, long, conflicts_with_all = ["file", "number"])]
pub list: Option<PathBuf>,
}
#[derive(Parser, Debug)]
pub struct SchemaOpts {}