Skip to content

Commit

Permalink
fix(Command): Regression introduced in cfd0afd
Browse files Browse the repository at this point in the history
Signed-off-by: prajwalch <prajwal.chapagain58@gmail.com>
  • Loading branch information
prajwalch committed Sep 4, 2024
1 parent 87a9498 commit 51a1f93
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Command.zig
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ pub fn deinit(self: *Command) void {
/// ```
pub fn addArg(self: *Command, arg: Arg) !void {
var new_arg = arg;
const is_positional = (arg.short_name == null) and (arg.long_name == null);

// If its not a positional argument, append it and return.
if ((new_arg.short_name != null) and (new_arg.long_name != null)) {
if (!is_positional) {
return self.options.append(self.allocator, new_arg);
}

Expand Down

0 comments on commit 51a1f93

Please sign in to comment.