use std::path::PathBuf;
use clap::Parser;
mod commands;
mod parse;
mod types;
pub(crate) use commands::Commands;
pub(crate) use types::{
AnsiMode, ConfigFormat, EventsFormat, GenerateCommands, OutputFormat, RmiScope,
};
const HELP_STYLES: clap::builder::Styles = clap::builder::Styles::plain()
.header(clap::builder::styling::AnsiColor::Green.on_default().bold())
.usage(clap::builder::styling::AnsiColor::Green.on_default().bold())
.literal(clap::builder::styling::AnsiColor::Cyan.on_default().bold())
.placeholder(clap::builder::styling::AnsiColor::Cyan.on_default());
#[derive(Parser)]
#[command(
name = "podup",
version,
about = "Run docker-compose projects on Podman.",
styles = HELP_STYLES,
// No subcommand prints help and exits non-zero (like docker compose), and the
// built-in `help` is replaced by an explicit `Help` variant that tolerates
// extra tokens, `-h`/`--help`, and a leading `--`.
arg_required_else_help = true,
disable_help_subcommand = true
)]
pub(crate) struct Cli {
#[arg(short, long)]
pub(crate) file: Vec<PathBuf>,
#[arg(short, long, env = "COMPOSE_PROJECT_NAME")]
pub(crate) project: Option<String>,
#[arg(long, env = "PODMAN_SOCKET", global = true)]
pub(crate) socket: Option<String>,
#[arg(long, value_delimiter = ',', env = "COMPOSE_PROFILES", global = true)]
pub(crate) profile: Vec<String>,
#[arg(long, global = true)]
pub(crate) project_directory: Option<PathBuf>,
#[arg(long = "env-file", global = true)]
pub(crate) env_file: Vec<String>,
#[arg(long, value_enum, default_value_t = AnsiMode::Auto, global = true)]
pub(crate) ansi: AnsiMode,
#[command(subcommand)]
pub(crate) command: Commands,
}