summaryrefslogtreecommitdiff
path: root/src/cli/args.zig
diff options
context:
space:
mode:
authorMitchell Hashimoto <mitchell.hashimoto@gmail.com>2023-10-27 15:57:20 -0700
committerMitchell Hashimoto <mitchell.hashimoto@gmail.com>2023-10-27 15:57:20 -0700
commit4104f78cba322da7210124aa3b8dc82e1ac5f545 (patch)
treeca7e947981aabc3c3b23aa519c191a9763676b5d /src/cli/args.zig
parent9c56bd5dba8e7a87ef1578e955c46d0e90c127b1 (diff)
cli: handle "-e" as the command to execute
Diffstat (limited to 'src/cli/args.zig')
-rw-r--r--src/cli/args.zig5
1 files changed, 5 insertions, 0 deletions
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: {