noclip: improve help generation formatting
There are still quirks here. It's worth deciding if help descriptions should be automatically hard-wrapped. Multi-line descriptions require appropriate indentation after the first line. Long descriptions will automatically be wrapped by the terminal. The refactoring itch continues to grow.
This commit is contained in:
parent
af71064d7f
commit
c870347f74
@ -304,9 +304,12 @@ pub fn CommandParser(
|
||||
);
|
||||
|
||||
try writer.writeAll(data.help);
|
||||
if (!std.mem.endsWith(u8, data.help, "\n")) {
|
||||
try writer.writeAll("\n");
|
||||
}
|
||||
|
||||
if (param_count.args > 0) {
|
||||
try writer.writeAll("\n\nArguments:\n");
|
||||
try writer.writeAll("\nArguments:\n");
|
||||
|
||||
for (args) |arg| {
|
||||
defer arg.deinit(alloc);
|
||||
|
Loading…
x
Reference in New Issue
Block a user