wavepeek 2.1.0

Command-line tool for RTL waveform inspection with deterministic machine-friendly output.
Documentation
use std::path::PathBuf;

use clap::{Args, ValueEnum};

use crate::cli::limits::LimitArg;
use crate::cli::sampling::SampleMode;

#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum, Default)]
#[value(rename_all = "kebab-case")]
pub enum CaptureMode {
    Match,
    #[default]
    Switch,
    Assert,
    Deassert,
}

#[derive(Debug, Args)]
pub struct PropertyArgs {
    /// Path to VCD/FST/FSDB waveform file
    #[arg(long, value_name = "FILE", help_heading = "Input options")]
    pub waves: PathBuf,
    /// Start of inclusive time range (e.g. 1234ns; omitted means dump start)
    #[arg(long, help_heading = "Selection options")]
    pub from: Option<String>,
    /// End of inclusive time range (e.g. 1234ns; omitted means dump end)
    #[arg(long, help_heading = "Selection options")]
    pub to: Option<String>,
    /// Canonical scope path for scope-relative signal and event names
    #[arg(long, help_heading = "Selection options")]
    pub scope: Option<String>,
    /// Event trigger expression (required; use `*` only with `--sample-mode native`)
    #[arg(long, required = true, help_heading = "Selection options")]
    pub on: String,
    /// Value sampling mode for event-selected rows
    #[arg(
        long,
        value_enum,
        default_value_t = SampleMode::PreEdge,
        value_name = "MODE",
        help_heading = "Selection options"
    )]
    pub sample_mode: SampleMode,
    /// Logical expression evaluated at selected event timestamps
    #[arg(long, help_heading = "Selection options")]
    pub eval: String,
    /// Capture mode: level (`match`) or edge (`switch`, `assert`, `deassert`)
    #[arg(
        long,
        value_enum,
        default_value_t = CaptureMode::Switch,
        value_name = "MODE",
        help_heading = "Output options"
    )]
    pub capture: CaptureMode,
    /// Maximum number of property rows (`unlimited` disables truncation, value must be > 0)
    #[arg(long, default_value = "50", help_heading = "Output options")]
    pub max: LimitArg,
    /// Machine-readable JSON output
    #[arg(long, help_heading = "Output options")]
    pub json: bool,
    /// Stream newline-delimited JSON output
    #[arg(long, conflicts_with = "json", help_heading = "Output options")]
    pub jsonl: bool,
}