From 4c14bfd5188bb61d7076bc33fccbcc6a5e9dac01 Mon Sep 17 00:00:00 2001 From: Komari Spaghetti Date: Sat, 8 May 2021 18:08:52 +0200 Subject: Modernize codebase * Better naming for variables * Follow naming style of enums * Use `writer()` instead of `outStream()` * Change many initializers to be a one liner * Don't explicitly initialize fields to their default value --- example/usage.zig | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'example/usage.zig') diff --git a/example/usage.zig b/example/usage.zig index 25e1a34..e044f1d 100644 --- a/example/usage.zig +++ b/example/usage.zig @@ -1,14 +1,12 @@ -const std = @import("std"); const clap = @import("clap"); +const std = @import("std"); pub fn main() !void { - const stderr = std.io.getStdErr().outStream(); - // clap.usage is a function that can print a simple usage message, given a // slice of Param(Help). There is also a usageEx, which can print a // usage message for any Param, but it is more verbose to call. try clap.usage( - stderr, + std.io.getStdErr().writer(), comptime &[_]clap.Param(clap.Help){ clap.parseParam("-h, --help Display this help and exit. ") catch unreachable, clap.parseParam("-v, --version Output version information and exit.") catch unreachable, -- cgit v1.2.3