use clap::{Parser, ValueEnum};
use std::path::PathBuf;
#[derive(Parser)]
#[command(name = "podbox")]
#[command(version = env!("PODBOX_VERSION"))]
#[command(about = "Podman-native container environment manager")]
#[command(
after_help = "Common workflow:\n \
podbox create <profile> Create and start a prebuilt environment\n \
podbox enter Open a shell in the active container\n \
podbox list Show managed containers\n \
podbox doctor Diagnose host and container issues"
)]
pub struct Cli {
#[arg(long, short)]
pub config: Option<PathBuf>,
#[arg(long, global = true)]
pub dry_run: bool,
#[arg(long, short = 'C', global = true)]
pub container: Option<String>,
#[arg(long, global = true)]
pub quiet: bool,
#[arg(long, short = 'v', action = clap::ArgAction::Count, global = true)]
pub verbose: u8,
#[command(subcommand)]
pub command: Command,
}
mod command;
pub use command::{Command, ExportCommand, ProfileCommand, SnapshotCommand};
#[derive(Debug, Clone, Copy, ValueEnum)]
pub enum OutputFormat {
Text,
Json,
}
#[derive(Debug, Clone, Copy, ValueEnum)]
pub enum Shell {
Bash,
Zsh,
Fish,
}
impl From<Shell> for clap_complete::shells::Shell {
fn from(s: Shell) -> Self {
match s {
Shell::Bash => clap_complete::shells::Shell::Bash,
Shell::Zsh => clap_complete::shells::Shell::Zsh,
Shell::Fish => clap_complete::shells::Shell::Fish,
}
}
}