Skip to content

Fix #2 (Panic when parsing argument list with an empty string)#3

Open
rollcat wants to merge 1 commit intotimtadh:masterfrom
rollcat:fix-empty-string
Open

Fix #2 (Panic when parsing argument list with an empty string)#3
rollcat wants to merge 1 commit intotimtadh:masterfrom
rollcat:fix-empty-string

Conversation

@rollcat
Copy link

@rollcat rollcat commented Jul 16, 2023

No description provided.

Copy link
Owner

@timtadh timtadh left a comment

Choose a reason for hiding this comment

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

LGTM modulo my comment on && versus ||.

break
} else if skip {
if arg[0] == '-' {
if len(arg) > 0 && arg[0] == '-' {
Copy link
Owner

Choose a reason for hiding this comment

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

should this be len(arg) <= 0 || arg[0] == '-'. I think you want || instead so that you still return an error about the missing argument for the emitted option.

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.

2 participants