use std::path::PathBuf;
use clap::Parser;
pub const EXAMPLES: &str = "\
Examples:
# Write generated code. Select artifacts in the configuration file:
oapi-codegen --config-file oapi-codegen.yaml --output-file src/api.rs api.yaml
# You can also set output with the `output:` configuration key:
oapi-codegen --config-file oapi-codegen.yaml api.yaml
You must provide a configuration file.
The configuration file must enable at least one artifact.
You must set output with --output-file or the `output:` configuration key:
# oapi-codegen.yaml
output: src/api.rs
generate:
models: true
std-http-server: true
client: true";
#[derive(Debug, Parser)]
#[command(name = "oapi-codegen", version, about, after_long_help = EXAMPLES)]
pub struct Cli {
pub spec_file: PathBuf,
#[arg(short = 'c', long)]
pub config_file: PathBuf,
#[arg(short = 'o', long)]
pub output_file: Option<PathBuf>,
#[arg(long, conflicts_with = "install_deps")]
pub check: bool,
#[arg(long)]
pub install_deps: bool,
}