athena/cli.rs
1//! Command-line interface definitions and argument parsing
2//!
3//! This module defines the CLI structure using `clap` with derive macros.
4//! It provides the main CLI entry point and command definitions for `build` and `apply`.
5
6use clap::Parser;
7
8use crate::{apply::Apply, build::Build};
9
10/// Managing AWS Athena Schemas
11#[derive(Parser, Debug)]
12#[command(author, version, about, long_about = None)]
13#[clap(arg_required_else_help(true))]
14#[clap(color(clap::ColorChoice::Auto))]
15pub struct Cli {
16 #[command(subcommand)]
17 pub cmd: Command,
18}
19
20#[derive(clap::Subcommand, Debug)]
21pub enum Command {
22 /// Build SQL from template path
23 Build(Build),
24 /// Build and execute SQL to Athena
25 Apply(Apply),
26}
27
28// Parse the command line arguments
29pub fn parse() -> Cli {
30 Cli::parse()
31}