From 8bba68e5a9717685da96df821399c5618d5500f8 Mon Sep 17 00:00:00 2001 From: torque Date: Sun, 10 Sep 2023 14:45:34 -0700 Subject: [PATCH] help: still print 0-length argument descriptions I think I had initially intended 0-length descriptions to be "hidden" options, but this doesn't really work well with arguments, and it also doesn't make intention clear. Perhaps an additional field should be added to the parameter specification to support hiding options (this does not make sense for non-named options). --- source/help.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/help.zig b/source/help.zig index f0cfedd..7ccd8d3 100644 --- a/source/help.zig +++ b/source/help.zig @@ -53,6 +53,8 @@ pub fn StructuredPrinter(comptime Writer: type) type { // TODO: lol return a real error if (indent >= self.wrap_width) return NoclipError.UnexpectedFailure; + if (text.len == 0) return; + // this assumes output stream has already had the first line properly // indented. var splitter = std.mem.split(u8, text, "\n"); @@ -227,8 +229,6 @@ pub fn HelpBuilder(comptime command: anytype) type { var just: usize = 0; inline for (comptime help_info.arguments) |arg| { - if (comptime arg.description.len == 0) continue; - const pair: AlignablePair = .{ .left = arg.name, .right = arg.description,