use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(name = "deltalens")]
#[command(
about = "Standalone CLI to inspect Delta Lake tables without Spark, JVM, or Python",
long_about = None
)]
#[command(version)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
#[arg(long, global = true)]
pub json: bool,
#[arg(long, global = true)]
pub plain: bool,
#[arg(long, global = true)]
pub no_header: bool,
#[arg(short, long, global = true)]
pub verbose: bool,
}
#[derive(Subcommand)]
pub enum Commands {
Inspect {
path: String,
#[arg(long)]
version: Option<u64>,
#[arg(long)]
fail_on_issues: bool,
},
Diff {
path: String,
#[arg(long, required = true)]
v1: u64,
#[arg(long, required = true)]
v2: u64,
#[arg(long, conflicts_with = "files_only")]
schema_only: bool,
#[arg(long, conflicts_with = "schema_only")]
files_only: bool,
#[arg(long)]
fail_on_breaking: bool,
},
Lineage {
path: String,
#[arg(long)]
last: Option<usize>,
#[arg(long)]
since: Option<String>,
#[arg(long)]
op: Option<String>,
#[arg(long)]
user: Option<String>,
},
Audit {
path: String,
#[arg(long)]
since: Option<String>,
#[arg(long)]
until: Option<String>,
#[arg(long)]
op: Option<String>,
#[arg(long)]
user: Option<String>,
},
Schema {
path: String,
#[arg(long, conflicts_with = "at")]
history: bool,
#[arg(long, conflicts_with = "history")]
at: Option<u64>,
},
Config {
#[command(subcommand)]
action: ConfigAction,
},
}
#[derive(Subcommand)]
pub enum ConfigAction {
Show,
Path,
Metrics,
Set { key: String, value: String },
}