From 4ec4273a8a3b0ab02f1a7e49e971da8b5a71a034 Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Thu, 24 Oct 2024 17:47:48 +0200 Subject: fix: Subcommand example comments needs a scroll to be read --- README.md | 12 ++++++------ example/subcommands.zig | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d36715c..6cc8ca9 100644 --- a/README.md +++ b/README.md @@ -208,11 +208,11 @@ pub fn main() !void { .diagnostic = &diag, .allocator = gpa, - // Terminate the parsing of arguments after parsing the first positional (0 is passed here - // because parsed positionals are, like slices and arrays, indexed starting at 0). + // Terminate the parsing of arguments after parsing the first positional (0 is passed + // here because parsed positionals are, like slices and arrays, indexed starting at 0). // - // This will terminate the parsing after parsing the subcommand enum and leave `iter` not - // fully consumed. It can then be reused to parse the arguments for subcommands + // This will terminate the parsing after parsing the subcommand enum and leave `iter` + // not fully consumed. It can then be reused to parse the arguments for subcommands .terminating_positional = 0, }) catch |err| { diag.report(std.io.getStdErr().writer(), err) catch {}; @@ -231,8 +231,8 @@ pub fn main() !void { } fn mathMain(gpa: std.mem.Allocator, iter: *std.process.ArgIterator, main_args: MainArgs) !void { - // The parent arguments are not used it, but there are cases where it might be useful, so the - // example shows how to pass the arguments around. + // The parent arguments are not used it, but there are cases where it might be useful, so + // the example shows how to pass the arguments around. _ = main_args; // The parameters for the subcommand diff --git a/example/subcommands.zig b/example/subcommands.zig index 531a4d6..fcd4fee 100644 --- a/example/subcommands.zig +++ b/example/subcommands.zig @@ -34,11 +34,11 @@ pub fn main() !void { .diagnostic = &diag, .allocator = gpa, - // Terminate the parsing of arguments after parsing the first positional (0 is passed here - // because parsed positionals are, like slices and arrays, indexed starting at 0). + // Terminate the parsing of arguments after parsing the first positional (0 is passed + // here because parsed positionals are, like slices and arrays, indexed starting at 0). // - // This will terminate the parsing after parsing the subcommand enum and leave `iter` not - // fully consumed. It can then be reused to parse the arguments for subcommands + // This will terminate the parsing after parsing the subcommand enum and leave `iter` + // not fully consumed. It can then be reused to parse the arguments for subcommands .terminating_positional = 0, }) catch |err| { diag.report(std.io.getStdErr().writer(), err) catch {}; @@ -57,8 +57,8 @@ pub fn main() !void { } fn mathMain(gpa: std.mem.Allocator, iter: *std.process.ArgIterator, main_args: MainArgs) !void { - // The parent arguments are not used it, but there are cases where it might be useful, so the - // example shows how to pass the arguments around. + // The parent arguments are not used it, but there are cases where it might be useful, so + // the example shows how to pass the arguments around. _ = main_args; // The parameters for the subcommand -- cgit v1.2.3