Skip to content

Commit

Permalink
Fixed Empty Option parsing w/ other Arguments
Browse files Browse the repository at this point in the history
- Stopped the parsing iterator from advancing when dealing with Empty Options.
- Fixed comment in Option's Config.
- Fixed an example name in `build.zig`.
  • Loading branch information
00JCIV00 committed Dec 8, 2024
1 parent a15be5b commit a6a834c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub fn build(b: *std.Build) void {
//==========================================
// Examples
//==========================================
const examples = &.{ "cova-demo", "basic-app", "logger" };
const examples = &.{ "cova-demo", "basic_app", "logger" };
var ex_arena = std.heap.ArenaAllocator.init(b.allocator);
defer ex_arena.deinit();
const ex_alloc = ex_arena.allocator();
Expand Down
2 changes: 1 addition & 1 deletion src/Option.zig
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pub const Config = struct {
/// 6. String (Alias Long Names)
/// 7. String (Value Type)
///
/// Note, a comma "," will automatically be placed between the short and long name if they both exist.
/// Note, the Name Separator (`name_sep_fmt`) will automatically be placed between the short and long name if they both exist.
usage_fmt: []const u8 = "{u}{?u}{s}{s}{?s}{s} <{s}>",
/// Format for each Alias Long Name in the Usage message.
///
Expand Down
1 change: 0 additions & 1 deletion src/cova.zig
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,6 @@ fn parseOpt(args: *ArgIteratorGeneric, comptime OptionType: type, opt: *const Op
if (opt.allow_empty) {
opt.val.setEmpty() catch
log.err("The Option '{s}' has already been set.", .{ opt.name });
_ = args.next();
return;
}
else if (!opt.val.hasCustomParseFn())
Expand Down

0 comments on commit a6a834c

Please sign in to comment.