CommandHelpText

A helper struct that will generate help text for a given command.

Description: This struct will construct a HelpTextBuilderSimple (via toBuilder, or a string via toString) that is populated via the information provided by the arguments found within CommandT, and also the information attached to CommandT itself.

Here is an example of a fully-featured piece of help text generated by this struct:

Usage: mytool MyCommand <InputFile> <OutputFile> <CompressionLevel> [-v|--verbose] [--encoding]

Description:
    This is a command that transforms the InputFile into an OutputFile

Positional Args:
    InputFile                    - The input file.
    OutputFile                   - The output file.

Named Args:
    -v,--verbose                 - Verbose output

Utility:
    Utility arguments used to modify the output.

    CompressionLevel             - How much to compress the file.
    --encoding                   - Sets the encoding to use.

The following UDAs are taken into account when generating the help text:

* Command

* CommandNamedArg

* CommandPositionalArg

* CommandArgGroup

Furthermore, certain aspects such as whether an argument is nullable or not are reflected within the help text output.

struct CommandHelpText (
alias CommandT
alias ArgBinderInstance = ArgBinder!()
) {}

Members

Functions

toBuilder
HelpTextBuilderSimple toBuilder(string appName)

Creates a HelpTextBuilderSimple which is populated with all the information available from CommandT.

toString
string toString(string appName)

Manifest constants

Info
enum Info;

The CommandInfo for the CommandT, ArgBinderInstance combo.

Parameters

CommandT

The command to create the help text for.

ArgBinderInstance

An instance of ArgBinder. Currently this is unused, but in the future this may be useful.

Meta