mirror of
https://github.com/imjasonh/krust
synced 2026-07-08 23:05:41 +00:00
- Add missing newlines at end of files - Remove trailing whitespace - Use next_back() instead of last() for DoubleEndedIterator - Use &Path instead of &PathBuf for function parameter 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
53 lines
1.3 KiB
Rust
53 lines
1.3 KiB
Rust
use clap::{Parser, Subcommand};
|
|
use std::path::PathBuf;
|
|
|
|
#[derive(Parser)]
|
|
#[command(name = "krust")]
|
|
#[command(author, version, about, long_about = None)]
|
|
pub struct Cli {
|
|
#[command(subcommand)]
|
|
pub command: Commands,
|
|
|
|
/// Enable verbose logging
|
|
#[arg(short, long, global = true)]
|
|
pub verbose: bool,
|
|
}
|
|
|
|
#[derive(Subcommand)]
|
|
pub enum Commands {
|
|
/// Build a container image from a Rust application
|
|
Build {
|
|
/// Path to the Rust project directory
|
|
#[arg(value_name = "DIRECTORY")]
|
|
path: Option<PathBuf>,
|
|
|
|
/// Target image reference (overrides KRUST_REPO)
|
|
#[arg(short, long, env = "KRUST_IMAGE")]
|
|
image: Option<String>,
|
|
|
|
/// Target platform (e.g., linux/amd64, linux/arm64)
|
|
#[arg(long, default_value = "linux/amd64")]
|
|
platform: String,
|
|
|
|
/// Skip pushing the image to the registry after building
|
|
#[arg(long)]
|
|
no_push: bool,
|
|
|
|
/// Repository prefix (e.g., ghcr.io/username)
|
|
#[arg(long, env = "KRUST_REPO")]
|
|
repo: Option<String>,
|
|
|
|
/// Additional cargo build arguments
|
|
#[arg(last = true)]
|
|
cargo_args: Vec<String>,
|
|
},
|
|
|
|
/// Push a built image to a container registry
|
|
Push {
|
|
/// Image reference to push
|
|
image: String,
|
|
},
|
|
|
|
/// Show version information
|
|
Version,
|
|
}
|