Skip to content

feat(commander): support positional argument completions#129

Open
AmirSa12 wants to merge 1 commit into
mainfrom
feat/commander-positional-completions
Open

feat(commander): support positional argument completions#129
AmirSa12 wants to merge 1 commit into
mainfrom
feat/commander-positional-completions

Conversation

@AmirSa12

@AmirSa12 AmirSa12 commented Jun 11, 2026

Copy link
Copy Markdown
Member

in this pr commander adapter now read the positional args. same as the other two adapters we have which finally makes us able not to skip the tests for this case.
before this PR, commander completions only worked for flags.

pnpm tsx examples/demo.commander.ts complete -- lint ""
main.ts  Main file
index.ts Index file
:4

@changeset-bot

changeset-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: da9fed9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@bomb.sh/tab@129

commit: da9fed9

@AmirSa12

AmirSa12 commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

@shadowspawn your review is very appreciated! Thanks in advance ❤️

so commander already exposes what we need on each command .registeredArguments (https://github.com/tj/commander.js/blob/ba6d13ddb4243e5913367734f8c159089ffe7834/lib/command.js#L31C5-L31C35) so we now walk that list and register each positional with tab's command.argument

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant