blob: 2c403fc8fa63afc61e78f6a6a526cff1edded6e0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
const std = @import("std");
const clap = @import("clap");
pub fn main() !void {
// First we specify what parameters our program can take.
// We can use `parseParam` to parse a string to a `Param(Help)`
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, ¶ms, std.heap.direct_allocator);
defer args.deinit();
_ = args.flag("--helps");
}
|