HelpSectionArgInfoContent

A content class for displaying information about a command line argument.

Notes: Please see this class' unittest to see an example of it's output.

Constructors

this
this(ArgInfo[] args, AutoAddArgDashes addDashes)

Members

Functions

getContent
string getContent(HelpSectionOptions options)
Undocumented in source. Be warned that the author may not have intended to support it.

Manifest constants

NAME_CHAR_LIMIT_DIVIDER
enum NAME_CHAR_LIMIT_DIVIDER;

The divisor used to determine how many characters to use for the arg's name(s)

Structs

ArgInfo
struct ArgInfo

The information about the arg.

Variables

MIDDLE_AFFIX
auto MIDDLE_AFFIX;

The string used to split an arg's name(s) from its description.

addDashes
AutoAddArgDashes addDashes;

Whether to add the dash prefix to the args' name(s). e.g. "--option" vs "option"

args
ArgInfo[] args;

All registered args.

Inherited Members

From IHelpSectionContent

getContent
string getContent(HelpSectionOptions options)

Generates a string to display inside of a help text section.

lineWrap
string lineWrap(HelpSectionOptions options, const(char)[] value)
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

auto content = new HelpSectionArgInfoContent(
    [
        HelpSectionArgInfoContent.ArgInfo(["v", "verbose"],           "Display detailed information about what the program is doing."),
        HelpSectionArgInfoContent.ArgInfo(["f", "file"],              "The input file."),
        HelpSectionArgInfoContent.ArgInfo(["super","longer","names"], "Some unusuable command with long names and a long description.")
    ],

    AutoAddArgDashes.yes
);
auto options = HelpSectionOptions(
    "    ",
    80
);

assert(content.getContent(options) ==
    "    -v,--verbose       - Display detailed information about what the program is\n"
   ~"                         doing.\n"
   ~"    -f,--file          - The input file.\n"
   ~"    --super,--longer,  - Some unusuable command with long names and a long desc\n"
   ~"    --names              ription.",

    "\n"~content.getContent(options)
);

Meta