From 9bff7f332b86a18ff2f34e5c59ebdad5336e9850 Mon Sep 17 00:00:00 2001 From: Komari Spaghetti Date: Sat, 17 Jul 2021 10:43:05 +0000 Subject: Use debug.print instead of deprecated debug.warn in examples fixes comment on #11 --- example/simple-ex.zig | 8 ++++---- example/simple.zig | 8 ++++---- example/streaming-clap.zig | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'example') diff --git a/example/simple-ex.zig b/example/simple-ex.zig index 838b9c2..5653fd1 100644 --- a/example/simple-ex.zig +++ b/example/simple-ex.zig @@ -36,11 +36,11 @@ pub fn main() !void { defer args.deinit(); if (args.flag("--help")) - debug.warn("--help\n", .{}); + debug.print("--help\n", .{}); if (args.option("--number")) |n| - debug.warn("--number = {s}\n", .{n}); + debug.print("--number = {s}\n", .{n}); for (args.options("--string")) |s| - debug.warn("--string = {s}\n", .{s}); + debug.print("--string = {s}\n", .{s}); for (args.positionals()) |pos| - debug.warn("{s}\n", .{pos}); + debug.print("{s}\n", .{pos}); } diff --git a/example/simple.zig b/example/simple.zig index 78a963c..ff6d301 100644 --- a/example/simple.zig +++ b/example/simple.zig @@ -26,11 +26,11 @@ pub fn main() !void { defer args.deinit(); if (args.flag("--help")) - debug.warn("--help\n", .{}); + debug.print("--help\n", .{}); if (args.option("--number")) |n| - debug.warn("--number = {s}\n", .{n}); + debug.print("--number = {s}\n", .{n}); for (args.options("--string")) |s| - debug.warn("--string = {s}\n", .{s}); + debug.print("--string = {s}\n", .{s}); for (args.positionals()) |pos| - debug.warn("{s}\n", .{pos}); + debug.print("{s}\n", .{pos}); } diff --git a/example/streaming-clap.zig b/example/streaming-clap.zig index 5f7f219..9ed38dd 100644 --- a/example/streaming-clap.zig +++ b/example/streaming-clap.zig @@ -44,13 +44,13 @@ pub fn main() !void { }) |arg| { // arg.param will point to the parameter which matched the argument. switch (arg.param.id) { - 'h' => debug.warn("Help!\n", .{}), - 'n' => debug.warn("--number = {s}\n", .{arg.value.?}), + 'h' => debug.print("Help!\n", .{}), + 'n' => debug.print("--number = {s}\n", .{arg.value.?}), // arg.value == null, if arg.param.takes_value == .none. // Otherwise, arg.value is the value passed with the argument, such as "-a=10" // or "-a 10". - 'f' => debug.warn("{s}\n", .{arg.value.?}), + 'f' => debug.print("{s}\n", .{arg.value.?}), else => unreachable, } } -- cgit v1.2.3