From bfe779cf9a560416b0eb9ab5013120868cd31424 Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Fri, 4 Sep 2026 16:59:13 -0500 Subject: [PATCH] feat: add base command with global options --- src/cli.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/cli.rs diff --git a/src/cli.rs b/src/cli.rs new file mode 100644 index 0000000..722023f --- /dev/null +++ b/src/cli.rs @@ -0,0 +1,25 @@ +use clap::Parser; + +#[derive(Debug, Parser)] +#[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, + + #[arg(long)] + #[arg(short = 'u')] + #[arg(env = "ONSPRING_BASE_URL")] + #[arg(help = "The base URL for the Onspring API")] + pub base_url: Option, + + #[arg(long)] + #[arg(short = 'p')] + #[arg(help = "Pretty-print JSON output")] + #[arg(default_value_t = false)] + pub pretty: bool, +}