View source code
Display the source code in std/getopt.d from which this page was generated on
github.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
local clone.
Page wiki
View or edit the community-maintained wiki page associated with this page.
Function std.getopt.defaultGetoptPrinter
This function prints the passed
and Option
text
in an aligned manner.
The passed text
will be printed first, followed by a newline. Than the short
and long version of every option will be printed. The short and long version
will be aligned to the longest option of every
passed. If a help
message is present it will be printed after the long version of the
Option
.
Option
foreach(it; opt) { writefln("%*s %*s %s", lengthOfLongestShortOption, it.optShort, lengthOfLongestLongOption, it.optLong, it.help); }
Prototype
void defaultGetoptPrinter( string text, Option[] opt );
Parameters
Name | Description |
---|---|
text | The text to printed at the beginning of the help output. |
opt | The extracted from the parameter. |