-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: short params parsing within zig-clap fork #14845
base: main
Are you sure you want to change the base?
Conversation
Can you add automated tests? |
c6660a5
to
eec63e1
Compare
@Jarred-Sumner of course, just rebased this branch against latest How do I unblock CI to run? |
2233c05
to
b97ff56
Compare
I was curious to see the diff between the Check it out here: main...renanmav:bun:renan/sync-zig-clap |
1302eaf
to
3b611eb
Compare
3b611eb
to
78bb5f3
Compare
return parser.err(arg, .{ .short = arg[index] }, error.InvalidArgument); | ||
if (warn_on_unrecognized_flag) { | ||
Output.warn("unrecognized bun flag: -{c}, continuing to parse and evaluate flag downstream...\n", .{arg[index]}); | ||
Output.flush(); | ||
} | ||
|
||
// Continue parsing after unrecognized flag | ||
parser.state = .normal; | ||
return parser.next(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main change of this PR
What does this PR do?
This pull request fixes an issue with parsing short parameters (e.g.,
-t
) in Bun's fork ofzig-clap
(upstream repo). The bug was causing errors when parsing single short flags, as reported in #7114. The fix ensures that short flags are correctly recognized and processed while maintaining compatibility with existing behavior.Note
I'm not super familiar with the Zig language, so I pushed this fix with the help of Cursor AI.
Apologies for any mistakes, appreciate your review.
Changes Made
How did you verify your code works?
I've built the package locally with code changes, and did testing using these commands:
Output:
Before
After