feat(xce-test-cli-ux): add flag typo-suggestion and help-block renderer

flagspec_reject() now names a likely-intended flag when an unrecognized
flag closely matches exactly one entry in the descriptor table (genuine
Levenshtein DP, silent on zero or ambiguous matches). flagspec_render_help()
generates the short/long/required-optional/default flag-listing block from
a descriptor table. 1278/1278 controller suite passing (+5).

Task 1.2 of .kiro/specs/xce-test-cli-ux/tasks.md.
Requirements: 6.1, 6.2, 6.3, 6.4, 8.2, 10.1, 10.2, 10.3

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019jaMf9QEwpugH2W9KAuc7f
This commit is contained in:
Rongsong Shen 2026-09-09 07:40:46 +00:00
parent 0748f10cc6
commit 89af46af3e
No known key found for this signature in database
GPG key ID: 5BCDAAE0123E9FE2
4 changed files with 335 additions and 17 deletions

View file

@ -9,7 +9,7 @@
- _Requirements: 2.1, 2.2, 2.3, 2.4, 3.1_
- _Boundary: Flag Parsing Layer_
- [ ] 1.2 Build the flag typo-suggestion utility and the generated help-flag-block renderer
- [x] 1.2 Build the flag typo-suggestion utility and the generated help-flag-block renderer
- Add a small edit-distance comparison so an unrecognized flag that closely matches exactly one flag in the descriptor table is named as the likely intended one in the rejection message
- Add a renderer that produces the flag-listing portion of help text (short form, long form, required/optional, default) directly from the descriptor table
- Observable completion: the unit test suite shows a single close-match flag typo producing a "did you mean" suggestion, a non-close-match producing no suggestion, and the renderer producing a correctly formatted block for a multi-flag test table