1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! Documentation metadata for `OrthoConfig`.
//!
//! This module defines the IR schema used by `cargo-orthohelp` and the
//! `OrthoConfigDocs` trait implemented by the derive macro.
pub use ;
/// Current IR schema version.
pub const ORTHO_DOCS_IR_VERSION: &str = "1.1";
/// Trait implemented for configs that can emit documentation metadata.
/// Trait implemented for `clap::Subcommand` enums that emit per-variant
/// documentation metadata.
///
/// Each returned [`DocMetadata`] entry describes one subcommand variant. The
/// generated implementation preserves enum declaration order so generated
/// documentation remains deterministic.
///
/// # Examples
///
/// ```rust,ignore
/// use clap::{Parser, Subcommand};
/// use ortho_config::{OrthoConfig, OrthoConfigSubcommandDocs};
/// use serde::{Deserialize, Serialize};
///
/// #[derive(Parser, OrthoConfig)]
/// #[ortho_config(prefix = "APP_")]
/// struct Cli {
/// #[command(subcommand)]
/// command: Commands,
/// }
///
/// #[derive(Subcommand, OrthoConfigSubcommandDocs)]
/// enum Commands {
/// Run(RunArgs),
/// }
///
/// #[derive(Parser, Serialize, Deserialize, Default, OrthoConfig)]
/// #[ortho_config(prefix = "APP_")]
/// struct RunArgs {
/// #[arg(long)]
/// name: String,
/// }
/// ```