nirv_engine/cli/
cli_args.rs1use clap::{Parser, Subcommand, ValueEnum};
2
3#[derive(Parser, Debug)]
5#[command(name = "nirv")]
6#[command(about = "Universal data virtualization and compute orchestration engine")]
7#[command(version = "0.1.0")]
8pub struct CliArgs {
9 #[command(subcommand)]
10 pub command: Commands,
11}
12
13#[derive(Subcommand, Debug)]
15pub enum Commands {
16 Query {
18 #[arg(value_name = "SQL")]
20 sql: String,
21
22 #[arg(short, long, default_value = "table")]
24 format: OutputFormat,
25
26 #[arg(short, long)]
28 config: Option<String>,
29
30 #[arg(short, long)]
32 verbose: bool,
33 },
34
35 Sources {
37 #[arg(short, long)]
39 detailed: bool,
40 },
41
42 Schema {
44 source: String,
46 },
47}
48
49#[derive(ValueEnum, Debug, Clone)]
51pub enum OutputFormat {
52 Table,
54 Json,
56 Csv,
58}
59
60impl std::fmt::Display for OutputFormat {
61 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
62 match self {
63 OutputFormat::Table => write!(f, "table"),
64 OutputFormat::Json => write!(f, "json"),
65 OutputFormat::Csv => write!(f, "csv"),
66 }
67 }
68}