From 4104f78cba322da7210124aa3b8dc82e1ac5f545 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 27 Oct 2023 15:57:20 -0700 Subject: cli: handle "-e" as the command to execute --- src/cli/args.zig | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/cli/args.zig') diff --git a/src/cli/args.zig b/src/cli/args.zig index fcb4c039c..eb91c43a8 100644 --- a/src/cli/args.zig +++ b/src/cli/args.zig @@ -64,6 +64,11 @@ pub fn parse(comptime T: type, alloc: Allocator, dst: *T, iter: anytype) !void { }; while (iter.next()) |arg| { + // Do manual parsing if we have a hook for it. + if (@hasDecl(T, "parseManuallyHook")) { + if (!try dst.parseManuallyHook(arena_alloc, arg, iter)) return; + } + if (mem.startsWith(u8, arg, "--")) { var key: []const u8 = arg[2..]; const value: ?[]const u8 = value: { -- cgit v1.2.3