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
use clap::{Parser, Subcommand};

pub mod analyze;
pub mod en_mass;

pub use analyze::*;
pub use en_mass::*;

#[derive(Parser)]
#[clap(version, about, long_about = None, name="Scayl")]
#[clap(
    author = "Dillon Shaffer<dillon@molkars.dev> & Cynthia Rosas",
)]
pub struct Cli {
    #[clap(subcommand)]
    pub subcommand: Commands,
}

#[derive(Subcommand)]
pub enum Commands {
    #[clap(about = "Analyze a piece of software using various vulnerability formats.")]
    Analyze {
        #[clap(long)]
        grype: Vec<String>,
        #[clap(long)]
        syft: Vec<String>,
        #[clap(long)]
        trivy: Vec<String>,
        #[clap(long)]
        cyclone: Vec<String>,
        #[clap(long)]
        context: String,
        #[clap(long)]
        file: Option<String>,
    },
    #[clap(about = "Analyze a directory of software using various vulnerability formats.")]
    EnMass {
        #[clap(value_parser)]
        path: String,
        #[clap(long)]
        context: String,
    },
}