mod attachment;
mod bug;
mod classification;
mod comment;
mod component;
mod config;
mod field;
mod group;
mod product;
mod query;
mod server;
mod template;
mod user;
mod whoami;
pub use attachment::AttachmentAction;
pub use bug::BugAction;
pub use classification::ClassificationAction;
pub use comment::CommentAction;
pub use component::ComponentAction;
pub use config::ConfigAction;
pub use field::FieldAction;
pub use group::GroupAction;
pub use product::ProductAction;
pub use query::QueryAction;
pub use server::ServerAction;
pub use template::TemplateAction;
pub use user::UserAction;
pub use whoami::WhoamiAction;
use clap::{Parser, Subcommand};
use crate::types::{ApiMode, OutputFormat};
#[derive(Parser)]
#[command(name = "bzr", version, verbatim_doc_comment)]
#[expect(
clippy::doc_markdown,
reason = "doc examples are literal shell commands; wrapping URLs in <> or identifiers in backticks would degrade copy-paste UX"
)]
pub struct Cli {
#[arg(long, global = true)]
pub server: Option<String>,
#[arg(long, global = true)]
pub output: Option<OutputFormat>,
#[arg(long, global = true)]
pub json: bool,
#[arg(long, global = true)]
pub no_color: bool,
#[arg(long, global = true)]
pub quiet: bool,
#[arg(long, global = true)]
pub api: Option<ApiMode>,
#[arg(short, long, action = clap::ArgAction::Count, global = true)]
pub verbose: u8,
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
#[expect(
clippy::doc_markdown,
reason = "doc examples are literal shell commands; wrapping URLs in <> or identifiers in backticks would degrade copy-paste UX"
)]
pub enum Commands {
#[command(verbatim_doc_comment)]
Bug {
#[command(subcommand)]
action: BugAction,
},
#[command(verbatim_doc_comment)]
Comment {
#[command(subcommand)]
action: CommentAction,
},
#[command(verbatim_doc_comment)]
Attachment {
#[command(subcommand)]
action: AttachmentAction,
},
#[command(verbatim_doc_comment)]
Config {
#[command(subcommand)]
action: ConfigAction,
},
#[command(verbatim_doc_comment)]
Product {
#[command(subcommand)]
action: ProductAction,
},
#[command(verbatim_doc_comment)]
Field {
#[command(subcommand)]
action: FieldAction,
},
#[command(verbatim_doc_comment)]
User {
#[command(subcommand)]
action: UserAction,
},
#[command(verbatim_doc_comment)]
Group {
#[command(subcommand)]
action: GroupAction,
},
#[command(verbatim_doc_comment)]
Whoami {
#[command(subcommand)]
action: Option<WhoamiAction>,
},
#[command(verbatim_doc_comment)]
Server {
#[command(subcommand)]
action: ServerAction,
},
#[command(verbatim_doc_comment)]
Classification {
#[command(subcommand)]
action: ClassificationAction,
},
#[command(verbatim_doc_comment)]
Component {
#[command(subcommand)]
action: ComponentAction,
},
#[command(verbatim_doc_comment)]
Template {
#[command(subcommand)]
action: TemplateAction,
},
#[command(verbatim_doc_comment)]
Query {
#[command(subcommand)]
action: QueryAction,
},
}
#[cfg(test)]
#[path = "mod_tests.rs"]
mod tests;