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
use crate::base::prove::{Prove, ProverOptions};
use clap::*;
use move_package::BuildConfig;
use std::path::PathBuf;
#[derive(Parser)]
#[clap(name = "docgen")]
pub struct Docgen {
#[clap(long = "quiet", short = 'q')]
pub quiet: bool,
#[clap(long = "template", short = 't', value_name = "FILE")]
pub template: Option<String>,
}
impl Docgen {
pub fn execute(self, path: Option<PathBuf>, config: BuildConfig) -> anyhow::Result<()> {
let mut options_list = vec!["--docgen".to_string()];
if self.quiet {
options_list.push("--verbose".to_string());
options_list.push("error".to_string());
}
if self.template.is_some() {
options_list.push("--docgen-template".to_string());
options_list.push(self.template.unwrap());
}
let options = Some(ProverOptions::Options(options_list));
Prove::execute(
Prove {
target_filter: None,
for_test: false,
options,
},
path,
config,
)
}
}