Files
onx/src/cli.rs
T

34 lines
790 B
Rust
Raw Normal View History

2026-09-04 18:09:25 -05:00
use clap::{Parser, Subcommand};
2026-09-04 16:59:13 -05:00
#[derive(Debug, PartialEq, Parser)]
2026-09-04 16:59:13 -05:00
#[command(name = "onx")]
#[command(version)]
#[command(about)]
pub struct Cli {
#[arg(long)]
#[arg(short = 'k')]
#[arg(env = "ONSPRING_API_KEY")]
#[arg(help = "The API key for the Onspring instance")]
pub api_key: Option<String>,
#[arg(long)]
#[arg(short = 'u')]
#[arg(env = "ONSPRING_BASE_URL")]
#[arg(help = "The base URL for the Onspring API")]
pub base_url: Option<String>,
#[arg(long)]
#[arg(short = 'p')]
#[arg(help = "Pretty-print JSON output")]
#[arg(default_value_t = false)]
pub pretty: bool,
2026-09-04 18:09:25 -05:00
#[command(subcommand)]
pub command: Command,
}
#[derive(Debug, PartialEq, Subcommand)]
pub enum Command {
#[command(about = "Check connectivity to the Onspring API")]
Ping,
2026-09-04 16:59:13 -05:00
}