Skip to content

Commit

Permalink
fix infinite loop while parsing in case first arg is not a flag (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
BROngineer authored Jun 15, 2024
1 parent 05d4a8e commit 1ef76e8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flagset.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func (fs *FlagSet) Parse(args []string) error {
i, err = fs.parseLong(args, i)
case strings.HasPrefix(args[i], shortFlagNamePrefix):
i, err = fs.parseShort(args, i)
default:
i++
}
if err != nil {
return err
Expand Down

0 comments on commit 1ef76e8

Please sign in to comment.