Skip to main content

blz_cli/args/
mod.rs

1//! Shared argument types and groups for the BLZ CLI.
2//!
3//! This module provides reusable argument definitions that can be composed
4//! across multiple commands using clap's `#[command(flatten)]` attribute.
5//!
6//! # Design Philosophy
7//!
8//! Rather than duplicating argument definitions across commands, shared
9//! argument groups ensure:
10//! - Consistent flag names and help text
11//! - Reduced code duplication
12//! - Easier maintenance and updates
13//!
14//! # Available Types
15//!
16//! ## Core Types
17//!
18//! - [`Verbosity`] - Output verbosity level (quiet/normal/verbose/debug)
19//!
20//! ## Argument Groups
21//!
22//! - [`PaginationArgs`] - Limit and offset for result pagination
23//! - [`ContextArgs`] - Context lines for content retrieval (grep-style)
24//! - [`OutputArgs`] - Format selection with TTY auto-detection
25//!
26//! # Examples
27//!
28//! ```ignore
29//! use blz_cli::args::{ContextArgs, OutputArgs, PaginationArgs, Verbosity};
30//! use clap::{Args, Parser};
31//!
32//! #[derive(Parser)]
33//! struct SearchCommand {
34//!     /// Search query
35//!     query: String,
36//!
37//!     #[command(flatten)]
38//!     pagination: PaginationArgs,
39//!
40//!     #[command(flatten)]
41//!     context: ContextArgs,
42//!
43//!     #[command(flatten)]
44//!     output: OutputArgs,
45//! }
46//! ```
47
48mod context;
49mod output;
50mod pagination;
51mod verbosity;
52
53pub use context::{ContextArgs, ContextMode};
54pub use output::{OutputArgs, OutputFormat};
55pub use pagination::PaginationArgs;
56pub use verbosity::Verbosity;