Öffentliche Dateiansicht: Raw-Dateien, Tree, Releases und Issues sind ohne Login verfügbar.
src/cli.rs Raw
 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
// Copyright (c) 2026 Adrian Lorenz <a.lorenz@noa-x.de>
// SPDX-License-Identifier: MIT

use clap::{Parser, Subcommand, ValueEnum};
use std::path::PathBuf;

#[derive(Parser)]
#[command(name = "leakguard", about = "🔍 Fast secret scanner for your codebase", version = "0.2.0")]
pub(crate) struct Cli {
    #[command(subcommand)]
    pub(crate) command: Commands,
}

#[derive(Subcommand)]
pub(crate) enum Commands {
    Check {
        #[arg(short, long, default_value = ".")]
        source: PathBuf,
        #[arg(short, long, default_value = "pretty")]
        format: OutputFormat,
        #[arg(short, long)]
        verbose: bool,
        #[arg(long, default_value = "1024")]
        max_size: u64,
        #[arg(short, long)]
        config: Option<PathBuf>,
        /// Write a GitHub Actions Job Summary to $GITHUB_STEP_SUMMARY
        #[arg(long)]
        github_summary: bool,
        /// Show WARNING-level findings in detail (hidden by default)
        #[arg(long)]
        warnings: bool,
    },
    Rules,
    InitConfig,
}

#[derive(ValueEnum, Clone)]
pub(crate) enum OutputFormat {
    Pretty,
    Json,
    Sarif,
    Markdown,
}