Skip to content

Commit d77965d

Browse files
refactor(cli): add default parameters to cli run entrypoint
- add default parameter to cli entrypoint using struct - pass struct property; exercise dir to iterateExerciseDirectory function
1 parent e4c68b1 commit d77965d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/cli/cli.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,12 @@ fn clear(self: *CLI) !void {
318318
STD.debug.print("{s}", .{STYLES.ASCII_STYLES.clear_prompt});
319319
}
320320

321-
pub fn run(allocator: STD.mem.Allocator) !void {
321+
pub fn run(allocator: STD.mem.Allocator, extra_options: struct { exercises_dir_path: []const u8 = "exercises" }) !void {
322322
const self = try allocator.create(CLI);
323323
defer allocator.destroy(self);
324324
self.* = .{ .allocator = allocator };
325325

326-
try iterateExerciseDirectory(self, .{});
326+
try iterateExerciseDirectory(self, .{ .dir_path = extra_options.exercises_dir_path });
327327

328328
try clear(self);
329329
try draw(self);

0 commit comments

Comments
 (0)