Run zig fmt on build
This commit is contained in:
parent
0b1dd505dd
commit
11753e80d6
|
@ -9,7 +9,9 @@ pub fn build(b: *Builder) void {
|
|||
|
||||
const fmt_step = b.addFmt(&[_][]const u8{
|
||||
"build.zig",
|
||||
"clap.zig",
|
||||
"clap",
|
||||
"example",
|
||||
});
|
||||
|
||||
const test_all_step = b.step("test", "Run all tests in all modes.");
|
||||
|
@ -51,6 +53,7 @@ pub fn build(b: *Builder) void {
|
|||
all_step.dependOn(example_step);
|
||||
all_step.dependOn(readme_step);
|
||||
|
||||
b.default_step.dependOn(&fmt_step.step);
|
||||
b.default_step.dependOn(all_step);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ pub fn main() !void {
|
|||
if (args.flag("--help"))
|
||||
debug.warn("--help\n", .{});
|
||||
if (args.option("--number")) |n|
|
||||
debug.warn("--number = {}\n", .{ n });
|
||||
debug.warn("--number = {}\n", .{n});
|
||||
for (args.positionals()) |pos|
|
||||
debug.warn("{}\n", .{ pos });
|
||||
debug.warn("{}\n", .{pos});
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ pub fn main() !void {
|
|||
if (args.flag("--help"))
|
||||
debug.warn("--help\n", .{});
|
||||
if (args.option("--number")) |n|
|
||||
debug.warn("--number = {}\n", .{ n });
|
||||
debug.warn("--number = {}\n", .{n});
|
||||
for (args.positionals()) |pos|
|
||||
debug.warn("{}\n", .{ pos });
|
||||
debug.warn("{}\n", .{pos});
|
||||
}
|
||||
|
|
|
@ -39,12 +39,12 @@ pub fn main() !void {
|
|||
// arg.param will point to the parameter which matched the argument.
|
||||
switch (arg.param.id) {
|
||||
'h' => debug.warn("Help!\n", .{}),
|
||||
'n' => debug.warn("--number = {}\n", .{ arg.value.? }),
|
||||
'n' => debug.warn("--number = {}\n", .{arg.value.?}),
|
||||
|
||||
// arg.value == null, if arg.param.takes_value == false.
|
||||
// Otherwise, arg.value is the value passed with the argument, such as "-a=10"
|
||||
// or "-a 10".
|
||||
'f' => debug.warn("{}\n", .{ arg.value.? }),
|
||||
'f' => debug.warn("{}\n", .{arg.value.?}),
|
||||
else => unreachable,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user