Skip to main content

mint_cli/output/
args.rs

1use std::path::PathBuf;
2
3use clap::{Args, ValueEnum};
4
5#[derive(Copy, Clone, Debug, Eq, PartialEq, ValueEnum)]
6pub enum OutputFormat {
7    Hex,
8    Mot,
9}
10
11/// Output configuration for the build command.
12#[derive(Args, Debug, Clone)]
13pub struct OutputArgs {
14    /// Output file path (e.g., "out/firmware.hex").
15    #[arg(
16        short = 'o',
17        long,
18        value_name = "FILE",
19        default_value = "out.hex",
20        help = "Output file path"
21    )]
22    pub out: PathBuf,
23
24    /// Number of bytes per HEX data record.
25    #[arg(
26        long,
27        value_name = "N",
28        default_value_t = 32u16,
29        value_parser = clap::value_parser!(u16).range(1..=64),
30        help = "Number of bytes per HEX data record (1..=64)",
31    )]
32    pub record_width: u16,
33
34    /// Output format: hex or mot.
35    #[arg(
36        long,
37        value_enum,
38        default_value_t = OutputFormat::Hex,
39        help = "Output format: hex or mot",
40    )]
41    pub format: OutputFormat,
42
43    /// Export used values as a JSON report.
44    #[arg(long, value_name = "FILE", help = "Export used values as JSON")]
45    pub export_json: Option<PathBuf>,
46
47    /// Show detailed build statistics.
48    #[arg(long, help = "Show detailed build statistics")]
49    pub stats: bool,
50
51    /// Suppress all output except errors.
52    #[arg(long, help = "Suppress all output except errors")]
53    pub quiet: bool,
54}