parse_options_from_usage_blocks

Function parse_options_from_usage_blocks 

Source
pub fn parse_options_from_usage_blocks(blocks: &[String]) -> Vec<OptionSpec>
Expand description

Attempt to parse option/flag lines from the usage blocks and OPTIONS sections.

Heuristic:

  • For each line in each block:
    • Trim leading whitespace.
    • If line starts with ‘-’ or ‘–’, assume it’s an option line.
    • Split into “flag part” and “description part”.
    • Parse flags like “-h”, “–help”, “-v, –verbose”, “-p | –paginate”.