You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
451 B
Zig

//! print-args prints all supplied args and then exits
const std = @import("std");
const stdout = std.io.getStdOut().writer();
pub fn main() !void {
var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
defer arena.deinit();
const alloc = &arena.allocator;
var args = std.process.args();
_ = args.next(alloc); // skip first arg
while (args.next(alloc)) |arg| {
try stdout.print("{}\n", .{arg});
}
}