Skip to content

feat: treat args after -- as positionals - #17

Open
webywz wants to merge 1 commit into
bombshell-dev:mainfrom
webywz:feat/double-dash-positionals
Open

webywz wants to merge 1 commit into
bombshell-dev:mainfrom
webywz:feat/double-dash-positionals

Conversation

@webywz

@webywz webywz commented Oct 30, 2026

Copy link
Copy Markdown

Summary

Handle the bare -- terminator so remaining argv tokens are collected as positionals even when they look like flags (e.g. -pos, --pos).

This matches the usual CLI pattern (grep -i -- -pos, printf, etc.) and addresses #12.

Changes

  • In parse(), when a token is exactly --, push every following token into _ (via coerce) and stop flag parsing.
  • The -- terminator itself is not included in _.
  • A later -- after the terminator is treated as a normal positional.
  • Add tests covering single-dash / double-dash positionals, mixed flags + terminator, and a trailing/empty terminator.
  • Add a minor changeset.

Intentionally does not implement #13 (options without delimiter such as -m700).

Test plan

  • pnpm test — 26 tests passed (including 5 new double-dash cases)
  • CI green on this PR

Fixes #12

Stop flag parsing at a bare `--` terminator so values like `-pos`
and `--pos` are collected into `_`, matching common CLI tools.

Fixes bombshell-dev#12
@changeset-bot

changeset-bot Bot commented Oct 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 11bddda

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bomb.sh/args Minor

Not sure what this means? Click here to learn what changesets are.

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

@gameroman gameroman added the maybe ai generated Likely generated by an AI agent label Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maybe ai generated Likely generated by an AI agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle positional arguments starting with a sigle or double dash

2 participants