Table of Contents

CliHelpBuilder Class

Definition

Namespace
DotMake.CommandLine
Assembly
DotMake.CommandLine.dll

Formats output to be shown to users to describe how to use a command line tool.

HelpBuilder is weirdly designed, i.e. it's hard to derive from that class due to static methods. CliHelpBuilder solves this problem by providing overridable methods, and it also adds color support.

public class CliHelpBuilder : HelpBuilder
Inheritance
CliHelpBuilder

Constructors

CliHelpBuilder(CliTheme, int)

Initializes a new instance of the CliHelpBuilder class.

Properties

MaxWidth

The maximum width for which to format help output.

(Inherited from HelpBuilder)
Theme

Gets the theme used by this CliHelpBuilder.

Methods

CustomizeLayout(Func<HelpContext, IEnumerable<Func<HelpContext, bool>>>)

Customizes the layout of the help output.

GetLayout(HelpContext)

Gets the default sections to be written for command line help.

GetTwoColumnRow(Symbol, HelpContext)

Gets a help item for the specified symbol.

Write(HelpContext)

Writes help output for the specified command.

WriteAdditionalArgumentsSection(HelpContext)

Writes a help section describing a command's additional arguments, typically shown only when TreatUnmatchedTokensAsErrors is set to true.

WriteColumns(IReadOnlyList<TwoColumnHelpRow>, HelpContext)

Writes the specified help rows, aligning output in columns.

WriteCommandArgumentsSection(HelpContext)

Writes a help section describing a command's arguments. Similar to:

Arguments:
<argument-1> Description for Argument1 [required]
WriteCommandOptionsSection(HelpContext)

Writes a help section describing a command's options. Similar to:

Options:
-o, --option-1 <option-1> Description for Option1 [default: DefaultForOption1]
-v, --version Show version information
-?, -h, --help Show help and usage information
WriteCommandUsageSection(HelpContext)

Writes a help section describing a command's usage. Similar to:

Usage:
TestApp <argument-1> [command] [options]
WriteSubcommandsSection(HelpContext)

Writes a help section describing a command's subcommands. Similar to:

Commands:
level-1 A nested level 1 sub-command
WriteSynopsisSection(HelpContext)

Writes a help section describing a command's synopsis. Similar to:

DotMake Command-Line TestApp v1.6.0
Copyright © 2023-2024 DotMake

A root cli command with nested children