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
60
61
62
63
64
65
66
67
68
69
70
71
72
//! Extension command and flag descriptors.
//!
//! These pure data structs allow providers to declare their extension
//! commands and provider-specific flags without depending on clap.
//! The obz shell reads these descriptors at startup and registers them
//! as real clap subcommands and arguments, giving full tab-completion
//! and `--help` support.
//!
//! # Design contract
//!
//! Every field in [`FlagDescriptor`] maps directly to a clap argument
//! attribute. obz must be able to losslessly convert a `FlagDescriptor`
//! into a `clap::Arg` without losing any information.
/// The value type of a provider-specific flag.
///
/// Maps to clap's `value_parser` and determines the Rust type used when
/// obz reads the parsed value back out of `ArgMatches`.
/// Descriptor for a single provider-specific flag.
///
/// Designed so that obz can convert it to a `clap::Arg` without any
/// additional information. All fields that clap needs are present here.
/// Descriptor for a provider extension command.
///
/// Extension commands are provider-specific subcommands (e.g.,
/// `metric top-queries`) that are registered into the core command
/// tree alongside the standard commands.