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
mod assign_id;
mod lint;
mod list_affected_versions;
mod osv;
mod version;
mod web;
use self::{
assign_id::AssignIdCmd, lint::LintCmd, list_affected_versions::ListAffectedVersionsCmd,
osv::OsvCmd, version::VersionCmd, web::WebCmd,
};
use crate::config::AppConfig;
use abscissa_core::{Command, Configurable, Runnable};
use clap::Parser;
use std::path::PathBuf;
#[derive(Command, Debug, Parser, Runnable)]
pub enum AdminSubCmd {
#[clap(about = "lint Advisory DB and ensure is well-formed")]
Lint(LintCmd),
#[clap(about = "render advisory Markdown files for the rustsec.org web site")]
Web(WebCmd),
#[clap(about = "display version information")]
Version(VersionCmd),
#[clap(about = "assigning RUSTSEC ids to new vulnerabilities")]
AssignId(AssignIdCmd),
#[clap(about = "export advisories to OSV format")]
Osv(OsvCmd),
#[clap(about = "list affected crate versions")]
ListAffectedVersions(ListAffectedVersionsCmd),
}
#[derive(Command, Debug, Parser)]
#[clap(author, version, about)]
pub struct AdminCmd {
#[clap(subcommand)]
cmd: AdminSubCmd,
#[clap(short = 'v', long, help = "Increase verbosity")]
pub verbose: bool,
}
impl Runnable for AdminCmd {
fn run(&self) {
self.cmd.run()
}
}
impl Configurable<AppConfig> for AdminCmd {
fn config_path(&self) -> Option<PathBuf> {
None
}
}