Skip to content

Commit 722125e

Browse files
committed
feat: cli-args example
1 parent 17dc901 commit 722125e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/cli-args.zig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const std = @import("std");
2+
3+
pub fn main() !void {
4+
const args = try std.process.argsAlloc(std.heap.page_allocator);
5+
defer std.process.argsFree(std.heap.page_allocator, args);
6+
7+
for (0..args.len) |i| {
8+
std.debug.print("\n{d}: {s}", .{ i, args[i] });
9+
}
10+
}

0 commit comments

Comments
 (0)