Browse Source
An argument whose choice pool (-choices plus -choicegroups members, deduplicated) has 1-3 members and -choicerestricted true (the default) now renders those words unitalicised joined by | in synopses - e.g 'after cancel' shows literal cancel, a 3-choice option shows (left|centre|right) - matching the display style of literal()/literalprefix() type-alternates. Larger or unrestricted choice sets keep the italicised argname/<type> display, and an explicit -typesynopsis always takes precedence (textblock::frame -type unchanged). New shared helper punk::args::private::synopsis_choice_literals feeds both synopsis render paths (leaders/values via synopsis_form_arg_display, options inline in synopsis); applies only to single-element -type lists. Superseded commented-out single-choice sketches removed; define doc for -choices documents the rule. tests: synopsis.test 4 -> 13 - characterization coverage for literal/literalprefix/stringstartswith/stringendswith type-alternates, option alternate parenthesization, multi-element clause display (?type? members, argname tail-word hints), -typesynopsis value-element lists and option passthrough incl documenter ANSI, plus the new choice-literal rule (leader/option/value positions, choicegroups counting, >3 and unrestricted fallbacks, -typesynopsis precedence). rendering.test choicelabel fixtures padded to 4 choices so markercol keeps matching the choices cell rather than the now-literal synopsis line. Known residue (deliberate): option-path -typesynopsis ?-trim edge cases remain (todo comments at the render site) - resolve-time rejection deferred; any future normalization surgery belongs to punk::ansi::ansistring/opunk::Str. project 0.12.0 Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.commaster
7 changed files with 245 additions and 23 deletions
@ -1,3 +1,3 @@
|
||||
[project] |
||||
name = "punkshell" |
||||
version = "0.11.0" |
||||
version = "0.12.0" |
||||
|
||||
Loading…
Reference in new issue