Skip to content

Commit

Permalink
feat(Command): Add Command.takesValue(b) setter
Browse files Browse the repository at this point in the history
This patch introduces a new setter for `Command.setting.takes_values`
previously you had to use either `Command.takesSingleValue` or `Command.takesNValues`
or set it manually.
  • Loading branch information
PrajwalCH committed Sep 1, 2022
1 parent efea318 commit f6ca476
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Command.zig
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ pub fn takesNValues(self: *Command, arg_name: []const u8, n: usize) !void {
if (n > 1) arg.valuesDelimiter(",");

try self.addArg(arg);
self.setting.takes_value = true;
self.takesValue(true);
}

/// Specifies that the command takes value. Default to 'false
pub fn takesValue(self: *Command, b: bool) void {
self.setting.takes_value = b;
}

/// Specifies that argument is required to provide. Default to `false`
Expand Down

0 comments on commit f6ca476

Please sign in to comment.