From 51a1f934fba25752e3e56b28b5393be37e6cdcf6 Mon Sep 17 00:00:00 2001 From: prajwalch Date: Wed, 4 Sep 2024 18:19:50 +0545 Subject: [PATCH] fix(Command): Regression introduced in cfd0afd Signed-off-by: prajwalch --- src/Command.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Command.zig b/src/Command.zig index 13374a3..ad9faf3 100644 --- a/src/Command.zig +++ b/src/Command.zig @@ -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); }