The OpenD Programming Language

defaultGetoptPrinter

This function prints the passed Options and text in an aligned manner on stdout.

The passed text will be printed first, followed by a newline, then 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 Option passed. If the option is required, then "Required:" will be printed after the long version of the Option. If a help message is present it will be printed next. The format is illustrated by this code:

foreach (it; opt)
{
    writefln("%*s %*s%s%s", lengthOfLongestShortOption, it.optShort,
        lengthOfLongestLongOption, it.optLong,
        it.required ? " Required: " : " ", it.help);
}
@safe
void
defaultGetoptPrinter
(
string text
,)

Parameters

text string

The text to printed at the beginning of the help output.

opt Option[]

The Option extracted from the getopt parameter.

Meta