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).
This commit is contained in:
parent
390a1ba4fd
commit
8bba68e5a9
@ -53,6 +53,8 @@ pub fn StructuredPrinter(comptime Writer: type) type {
|
|||||||
// TODO: lol return a real error
|
// TODO: lol return a real error
|
||||||
if (indent >= self.wrap_width) return NoclipError.UnexpectedFailure;
|
if (indent >= self.wrap_width) return NoclipError.UnexpectedFailure;
|
||||||
|
|
||||||
|
if (text.len == 0) return;
|
||||||
|
|
||||||
// this assumes output stream has already had the first line properly
|
// this assumes output stream has already had the first line properly
|
||||||
// indented.
|
// indented.
|
||||||
var splitter = std.mem.split(u8, text, "\n");
|
var splitter = std.mem.split(u8, text, "\n");
|
||||||
@ -227,8 +229,6 @@ pub fn HelpBuilder(comptime command: anytype) type {
|
|||||||
|
|
||||||
var just: usize = 0;
|
var just: usize = 0;
|
||||||
inline for (comptime help_info.arguments) |arg| {
|
inline for (comptime help_info.arguments) |arg| {
|
||||||
if (comptime arg.description.len == 0) continue;
|
|
||||||
|
|
||||||
const pair: AlignablePair = .{
|
const pair: AlignablePair = .{
|
||||||
.left = arg.name,
|
.left = arg.name,
|
||||||
.right = arg.description,
|
.right = arg.description,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user