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
//! The per-subcommand modules.
//!
//! One file per command: each holds its executor and its command-specific
//! error type. Parsing is not here -- clap owns the whole command surface in
//! [`super::parser`], and [`super::execute`] routes a parsed
//! [`Subcommand`](super::parser::Subcommand) to `commands::<name>::run`.
//!
//! Keeping the executors split this way is what lets a command's error say
//! something specific: `db:fresh` refusing without `--force` and
//! `storage:link` refusing to overwrite are different failures, and neither
//! reads well as a generic "command failed".
//!
//! Commands that need a capability the build may not have are gated on the
//! same features their parser variants are: `queue` on `database` + `jobs`,
//! `doctor` on `database`, `key:generate` on `auth`, and the three
//! application-graph commands -- `routes`, `typegen` and `build` -- on `uag`,
//! which is what carries the artifact they all read.
// The application-graph commands. They deserialize the UAG artifact and run
// its validator and codegen, so without `uag` there is nothing for them to
// read and they are absent rather than present-and-failing.
/// A cause whose concrete type is an implementation detail.
///
/// The three application-graph commands all fail the same way when the graph
/// cannot be read, and the reader lives in a private module. Boxing keeps
/// [`std::error::Error::source`] working without publishing that module's
/// error type as part of the crate's surface.
pub type Cause = ;
pub