Skip to content

Commit

Permalink
Fix option lookup
Browse files Browse the repository at this point in the history
Closes #30
  • Loading branch information
sam701 committed Dec 18, 2023
1 parent 7fc427b commit cf4a6a8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/parser.zig
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,8 @@ pub fn Parser(comptime Iterator: type) type {
if (std.mem.eql(u8, "help", option_name)) {
return &help_option;
}
var ix = self.command_path.items.len - 1;
while (ix >= 0) : (ix -= 1) {
const cmd = self.command_path.items[ix];
for (0..self.command_path.items.len) |ix| {
const cmd = self.command_path.items[self.command_path.items.len - ix - 1];
if (cmd.options) |option_list| {
for (option_list) |option| {
if (std.mem.eql(u8, option.long_name, option_name)) {
Expand Down

0 comments on commit cf4a6a8

Please sign in to comment.