private void print_help(const ref GetoptResult help_info) { import core.runtime; import std.path : baseName; import std.algorithm : map, maxElement; writefln("Usage: %s [OPTION...]", Runtime.args[0].baseName); writeln(); writeln("Convert D .lst coverage files to LCOV format."); writeln(); writeln("Options:"); string[] flags; foreach (opt; help_info.options) flags ~= opt.optShort ~ (opt.optShort.length ? ", " : " ") ~ opt.optLong; size_t width = flags.map!(f => f.length).maxElement + 1; foreach (i, opt; help_info.options) writefln(" %-*s %s", width, flags[i], opt.help); }