Files
nfi/src/subcommands.zig
T

33 lines
763 B
Zig

const std = @import("std");
pub const Handler = *const fn (*std.process.Args.Iterator) anyerror!void;
pub const Subcommand = struct {
name: []const u8,
handler: Handler,
};
pub const subcommands = [_]Subcommand{
.{ .name = "add", .handler = handleAdd },
.{ .name = "remove", .handler = handleRemove },
.{ .name = "done", .handler = handleDone },
.{ .name = "list", .handler = handleList },
};
pub fn handleAdd(args: *std.process.Args.Iterator) !void {
_ = args;
std.debug.print("add!", .{});
}
pub fn handleRemove(args: *std.process.Args.Iterator) !void {
_ = args;
}
pub fn handleDone(args: *std.process.Args.Iterator) !void {
_ = args;
}
pub fn handleList(args: *std.process.Args.Iterator) !void {
_ = args;
}