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
//! Command Line Interface for Ferrous Forge
//!
//! This module defines the CLI structure and argument parsing using clap.
use clap::Parser;
/// Ferrous Forge - The Type-Safe Rust Development Standards Enforcer
#[derive(Parser)]
#[command(author, version, about, long_about = None)]
#[command(propagate_version = true)]
pub struct Cli {
/// The command to execute
#[command(subcommand)]
pub command: crate::commands::Commands,
/// Enable verbose output
#[arg(short, long, global = true)]
pub verbose: bool,
/// Output format
#[arg(long, value_enum, default_value_t = OutputFormat::Human, global = true)]
pub format: OutputFormat,
/// Configuration file path
#[arg(short, long, global = true)]
pub config: Option<std::path::PathBuf>,
}
/// Output format options
#[derive(clap::ValueEnum, Clone, Debug)]
pub enum OutputFormat {
/// Human-readable output
Human,
/// JSON output
Json,
/// YAML output
Yaml,
}