Repository navigation
Parse kingpin/argparse/brace-choice listings; add 140+ corpus fixtures - #10
Merged
Merged
Conversation
- col-0 'name [args]' entries inside known sections take priority over
flatEntry (kingpin: aws-vault, saml2aws)
- 'positional arguments'/'required arguments' count as sections only
when a command metavariable ({a,b}, COMMAND, <command>) appears,
keeping meson/pdm arg lists from fabricating commands
- brace-choice tokens ({check,upload,register}) expand to names
- 'name (alias)' parenthesized aliases inside entry lines (tox)
- indented group headers no longer end a recognized section (copilot)
- ANSI escape sequences stripped before parsing (step)
- UUID-looking and driver-list tokens rejected as names (gscloud, goose)
- tool-prefix colon entries without a trailing description (git lfs X:)
Corpus: ~140 new captured CLIs (NOTICE updated), synthetic fixtures for
AGPL symfony/zitadel and MPL garden/terramate, local rows for sealos/
hasura/gadgetctl. Manifest 612 rows.
Co-Authored-By: syumai <syumai@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Parser gains for four real-world help layouts plus ~140 new captured CLIs; the manifest grows to 612 rows.
Parser (
internal/helptext/parse.go)name [args]at col-0: inside a recognized section a column-0 line is now tried asparseEntryLinebeforeflatEntry. aws-vault/saml2aws/tccli writehelp [<command>...]/add [<flags>] <profile>entries unindented underCommands:—flatEntrywas misrouting them into a tentative flat section that never committed, yielding 0 commands.positional arguments:sections are now a recognized header, but gated: the section commits only when a command metavariable appears ({a,b,c}, bareCOMMAND, or<command>). This captures pipenv/twine/pre-commit/alembic/ansible-builder/borg listings while keeping meson'sbuilddir/sourcedir, pdm'skey/value, and pipx'spackagesargument lists from fabricating commands.{check,upload,register}expands into names (twine, tox's{run,r,...}line).name (alias)parenthesized aliases in entry lines (tox'srun (r) run environments).Develop ✨/Release 🚀subgroup titles previously ended the section atinit,docs; now all groups parse (14 commands).\x1b[...m) — step's colorized help parses.37d53278-…from gscloud's example tables) and adriverheader skip word (goose'sDrivers:list) no longer leak as commands.tool sub name:prefix entries without trailing desc (git lfs'sgit lfs checkout:with the description on the next line) now register — git-lfs yields all 33 commands.Corpus
symfony/zitadel(AGPL-3.0),garden/terramate(MPL-2.0) get hand-written format fixtures per the repo's licensing policy.source=localrows:sealos(Sustainable Use License — non-standard, no committed output),hasura/gadgetctl(help capture times out in non-interactive runs).dep/terminus/pgcli(runtime errors),rustic(glibc build — recaptured with musl),tccli(bracketed service inventory, not a command listing).kube-scoreisempty(has[action]s but help doesn't enumerate them).Manifest: 612 rows (was 450).
go test ./internal/helptextgreen;docs/supported-commands.mdregenerated.Link to Devin session: https://app.devin.ai/sessions/6b27c26293e1466cb4b3f495d9cf77ea
Open in Devin Desktop: https://app.devin.ai/desktop/session/6b27c26293e1466cb4b3f495d9cf77ea?variant=devin
Requested by: @syumai