rustsec_admin/
commands.rs1mod assign_id;
4mod lint;
5mod list_affected_versions;
6mod osv;
7mod sync;
8mod version;
9mod web;
10
11use self::{
12 assign_id::AssignIdCmd, lint::LintCmd, list_affected_versions::ListAffectedVersionsCmd,
13 osv::OsvCmd, sync::SyncCmd, version::VersionCmd, web::WebCmd,
14};
15use crate::config::AppConfig;
16use abscissa_core::{Command, Configurable, Runnable};
17use clap::Parser;
18use std::path::PathBuf;
19
20#[derive(Command, Debug, Parser, Runnable)]
22pub enum AdminSubCmd {
23 #[command(about = "lint Advisory DB and ensure is well-formed")]
25 Lint(LintCmd),
26
27 #[clap(about = "synchronize information from external sources (osv.dev, NVD, etc.)")]
29 Sync(SyncCmd),
30
31 #[command(about = "render advisory Markdown files for the rustsec.org web site")]
33 Web(WebCmd),
34
35 #[command(about = "display version information")]
37 Version(VersionCmd),
38
39 #[command(about = "assigning RUSTSEC ids to new vulnerabilities")]
41 AssignId(AssignIdCmd),
42
43 #[command(about = "export advisories to OSV format")]
45 Osv(OsvCmd),
46
47 #[command(about = "list affected crate versions")]
49 ListAffectedVersions(ListAffectedVersionsCmd),
50}
51
52#[derive(Command, Debug, Parser)]
54#[command(author, version, about)]
55pub struct AdminCmd {
56 #[command(subcommand)]
57 cmd: AdminSubCmd,
58
59 #[arg(short = 'v', long, help = "Increase verbosity")]
61 pub verbose: bool,
62}
63
64impl Runnable for AdminCmd {
65 fn run(&self) {
66 self.cmd.run()
67 }
68}
69
70impl Configurable<AppConfig> for AdminCmd {
71 fn config_path(&self) -> Option<PathBuf> {
73 None
74 }
75}