Thanks to visit codestin.com
Credit goes to github.com

Skip to content

test: regression for #2234 empty positional arg after a flag#2328

Merged
dearchap merged 1 commit into
urfave:mainfrom
c-tonneslan:empty-arg-with-flag-regression
May 16, 2026
Merged

test: regression for #2234 empty positional arg after a flag#2328
dearchap merged 1 commit into
urfave:mainfrom
c-tonneslan:empty-arg-with-flag-regression

Conversation

@c-tonneslan
Copy link
Copy Markdown
Contributor

@c-tonneslan c-tonneslan commented May 15, 2026

What type of PR is this?

  • bug

What this PR does / why we need it

Issue #2234 reported that an empty positional arg following a flag (e.g. app -f=val "" arg2 arg3) got dropped along with every arg after it. The bug isn't reproducible on current main (the existing TestEmptyPositionalArgs cases all pass), but there's no test that pins down the case where a flag and an empty positional are mixed, which is exactly what the issue described.

Adding a small regression test so the case doesn't quietly break again. Covers both -f=val and -f val forms.

Which issue(s) this PR fixes

Fixes #2234

Testing

go test -run TestEmptyPositionalArgs -v passes both the existing cases and the two new ones.

Release Notes

NONE

@c-tonneslan c-tonneslan requested a review from a team as a code owner May 15, 2026 19:15
Copy link
Copy Markdown
Member

@Juneezee Juneezee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@dearchap dearchap merged commit 30e57ad into urfave:main May 16, 2026
9 checks passed
c-tonneslan added a commit to c-tonneslan/portfolio that referenced this pull request May 16, 2026
Add an optional status="merged" field on PR entries and render a small
green "merged" badge next to the title in ContribCard. Mark the three
PRs that have actually been merged so far (jackc/pgx#2554,
nats-io/nats.go#2076, urfave/cli#2328).

Drop the two closed-without-merge PRs that were still listed
(go-chi/chi#1093, tailscale/tailscale#19689). Closed PRs aren't
something I want to show off, so the data file just never carries
them, no need for a "closed" status.

Signed-off-by: Charlie Tonneslan <[email protected]>
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.

An empty argument and all subsequent arguments are dropped

3 participants