feat: basic functionality
This commit is contained in:
+43
@@ -0,0 +1,43 @@
|
||||
use clap::Parser;
|
||||
use std::path::PathBuf;
|
||||
|
||||
/// Enter chroot environments with Linux namespaces
|
||||
#[derive(Parser, Debug, Clone)]
|
||||
#[command(author, version, about, long_about = None, override_usage = "ecr [OPTIONS] <DISTRO[:VERSION]> -- [COMMAND]...")]
|
||||
pub struct Args {
|
||||
/// Distribution name (e.g., ubuntu, debian, arch, alpine, fedora)
|
||||
#[arg(value_name = "DISTRO[:VERSION]")]
|
||||
pub distro: String,
|
||||
|
||||
/// Target architecture
|
||||
#[arg(short, long, value_name = "ARCH")]
|
||||
pub arch: Option<String>,
|
||||
|
||||
/// Directory to overlay-mount (can be specified multiple times, default: current directory)
|
||||
#[arg(long, value_name = "PATH")]
|
||||
pub bind: Vec<PathBuf>,
|
||||
|
||||
/// Directory to bind-mount read-write at /mnt/<basename> (overrides regular bind, can be specified multiple times)
|
||||
#[arg(long, value_name = "PATH")]
|
||||
pub bind_rw: Vec<PathBuf>,
|
||||
|
||||
/// Download fresh tarball, ignore cache
|
||||
#[arg(long)]
|
||||
pub no_cache: bool,
|
||||
|
||||
/// Skip mounting any directory
|
||||
#[arg(long)]
|
||||
pub no_bind: bool,
|
||||
|
||||
/// Print diagnostic messages (URLs, manifest info, extraction steps, etc.)
|
||||
#[arg(short = 'v', long)]
|
||||
pub verbose: bool,
|
||||
|
||||
/// Command to run inside the chroot (default: interactive shell)
|
||||
#[arg(
|
||||
trailing_var_arg = true,
|
||||
allow_hyphen_values = true,
|
||||
value_name = "COMMAND"
|
||||
)]
|
||||
pub command: Vec<String>,
|
||||
}
|
||||
Reference in New Issue
Block a user