Skip to content

Commit 961f48a

Browse files
feat(cli): add generate patch flag
1 parent db5c2b0 commit 961f48a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main.zig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
const STD = @import("std");
22
const CLI = @import("cli/cli.zig");
3+
const PATCH_SYSTEM = @import("cli/patch.zig");
34

45
pub fn help_documentation() void {
56
STD.debug.print("{s}\n", .{CLI.ASCII_ART});
67
STD.debug.print("cpplings [OPTION]\n\n", .{});
78
STD.debug.print("Options:\n", .{});
89
STD.debug.print("-h | --help | help -> output this help documentation\n", .{});
10+
STD.debug.print("-p | --patch -> generate patch files\n", .{});
911
STD.debug.print("-s | --solutions -> run and test cpplings against solutions dir\n", .{});
1012
}
1113

@@ -28,6 +30,8 @@ pub fn main() !void {
2830

2931
if (STD.mem.eql(u8, PROGRAM_ARGUMENT, "-s") or STD.mem.eql(u8, PROGRAM_ARGUMENT, "--solutions")) {
3032
try CLI.run(mem_allocator, .{ .exercises_dir_path = ".patches/solutions" });
33+
} else if (STD.mem.eql(u8, PROGRAM_ARGUMENT, "-p") or STD.mem.eql(u8, PROGRAM_ARGUMENT, "--patch")) {
34+
try PATCH_SYSTEM.run(mem_allocator);
3135
} else if (STD.mem.eql(u8, PROGRAM_ARGUMENT, "-h") or STD.mem.eql(u8, PROGRAM_ARGUMENT, "--help") or STD.mem.eql(u8, PROGRAM_ARGUMENT, "help")) {
3236
help_documentation();
3337
} else {

0 commit comments

Comments
 (0)