Skip to main content

Module cli

Module cli 

Source
Expand description

Command-line argument definitions and helper functions.

Args is the root Clap struct parsed in main.rs. Helper functions (resolve_model, validate_model, parse_rate_range, apply_template) are kept here rather than in main.rs so they can be unit-tested in isolation.

Structs§

Args

Functions§

apply_template
Apply template substitution: replace “{input}” with the prompt.
parse_rate_range
Parse “MIN-MAX” rate range string. Returns (min, max) or None on error.
resolve_model
Select the appropriate default model for the given provider when the user hasn’t explicitly chosen one (i.e. the model is still the OpenAI default).
validate_model
Warn if model does not match any known model for provider. Never errors — unknown models are still forwarded to the API.