guardy 0.2.4

Fast, secure git hooks in Rust with secret scanning and protected file synchronization
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! CLI arguments static storage for config system access

use std::sync::OnceLock;

use clap::Parser;

use super::commands::Cli;

/// Global CLI - parsed once, accessed everywhere
pub static CLI: OnceLock<Cli> = OnceLock::new();

/// Initialize CLI (called once from main)
pub fn init() -> &'static Cli {
    if CLI.set(Cli::parse()).is_err() {
        tracing::debug!("CLI already initialized, returning existing instance");
    }
    CLI.get().unwrap()
}