Skip to main content

spec_driven_docs/cli/
read.rs

1//! Shared parse-shape for the embedded-document readers.
2//!
3//! `method`, `spec`, and `template` all take one optional name and a
4//! `--list` flag; the shelf they read is the subcommand's identity.
5//! No I/O, no business logic.
6
7/// Read one embedded document, or list the shelf.
8#[derive(Debug, clap::Args)]
9pub struct ReadArgs {
10    /// The document's short name.
11    #[arg(required_unless_present = "list")]
12    pub name: Option<String>,
13
14    /// List every document on this shelf instead.
15    #[arg(long, conflicts_with = "name")]
16    pub list: bool,
17}