Skip to main content

kagami/
command_line.rs

1use crate::advisory::Severity;
2use crate::{LogLevel, OutputFormat};
3use clap::Parser;
4
5#[derive(Parser, Debug)]
6#[command(name = "kagami")]
7#[command(version)]
8#[command(
9    about = "This simple tool checks whether there are any publicly disclosed vulnerabilities in a list of defined software.",
10    long_about= None
11)]
12pub struct KagamiCommands {
13    /// Sets an output format, overriding the one in the config file [default: text]
14    #[arg(short, long, value_enum)]
15    pub output_format: Option<OutputFormat>,
16    /// Sets a log level, overriding the one in the config file [default: warn]
17    #[arg(short, long, value_enum)]
18    pub log_level: Option<LogLevel>,
19    /// If a vulnerability of the specified severity or higher is detected, it will exit with an exit code of 1 to indicate failure.
20    /// If no severity is specified, it will always exit with a code of 0 unless an error occurs.
21    #[arg(short, long, value_enum)]
22    pub fail_on_severity: Option<Severity>,
23    /// Sets a path to the config file, relative to the current directory.
24    #[arg(default_value = "kagami.yaml")]
25    pub config_file_path: String,
26}