Agent-friendly argument normalization that auto-corrects common CLI syntax mistakes before cobra parses them: - Single-dash long flags: -zip -> --zip - Bare key=value: zip=33101 -> --zip=33101 - Typos via Levenshtein distance (max 2): --ziip -> --zip - Command typos: categoriess -> categories - Flag aliases: --zipcode, --dept, --search -> canonical names Corrections emit a "note:" line to stderr showing what was rewritten. Positional arguments for completion/help subcommands are preserved (e.g., "completion zsh" is not rewritten). Integration tests verify end-to-end behavior including tolerance notes, double-dash boundaries, and help output for rewritten args.
2.2 KiB
2.2 KiB