Skip to main content

args_to_events

Function args_to_events 

Source
pub fn args_to_events(args: &Args) -> Vec<CliEvent>
Expand description

Convert CLI arguments into a sequence of events.

This function maps each relevant field in the Args struct to a corresponding CliEvent. Events are generated in a deterministic order, with later events taking precedence over earlier ones (last-wins semantics).

§Event Ordering

Events are generated in this order:

  1. Verbosity flags (–quiet, –full, –debug, -v)
  2. Preset flags (–quick, –rapid, –long, –standard, –thorough)
  3. Explicit iteration counts (-D, -R)
  4. Agent selection (-a, -r, model flags)
  5. Configuration flags (–no-isolation, –review-depth, etc.)
  6. Finalization event

This ordering ensures that:

  • Explicit overrides (like -D) come after presets and override them
  • Last-specified preset wins if multiple are given

§Arguments

  • args - The parsed CLI arguments from clap

§Returns

A vector of CliEvents representing all specified CLI arguments.