zig-clap/example/simple-error.zig
Komari Spaghetti 4c14bfd518 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
2021-05-08 18:08:52 +02:00

14 lines
343 B
Zig

const clap = @import("clap");
const std = @import("std");
pub fn main() !void {
const params = comptime [_]clap.Param(clap.Help){
clap.parseParam("-h, --help Display this help and exit.") catch unreachable,
};
var args = try clap.parse(clap.Help, &params, .{});
defer args.deinit();
_ = args.flag("--helps");
}