Skip to content

Commit

Permalink
feat(cli): use empty accents value
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesrocket committed Dec 7, 2024
1 parent b054b9e commit 1f7b3d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/cli.zig
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ pub const setup_cmd: CommandT = .{
.description = "Enable symbol accentuations " ++ genVals(Accent, null) ++ ".",
.short_name = 'a',
.long_name = "accents",
.allow_empty = true,
.val = ValueT.ofType(Accent, .{
.name = "accents_list",
.alias_child_type = "[string]",
Expand Down
7 changes: 7 additions & 0 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,13 @@ pub fn main() !void {

if (opts.get("accents")) |accents| {
core.accents = accents.val.getAllAs(Accent) catch null;
if (accents.val.isEmpty()) {
core.accents = &[_]Accent{
.bright,
.bold,
.dim,
};
}
}

if (main_cmd.checkFlag("version")) {
Expand Down

0 comments on commit 1f7b3d8

Please sign in to comment.