CliHelpBuilder Class

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.

Definition

Namespace: DotMake.CommandLine
Assembly: DotMake.CommandLine (in DotMake.CommandLine.dll) Version: 1.8.8
C#
public class CliHelpBuilder : HelpBuilder
Inheritance
Object    HelpBuilder    CliHelpBuilder

Constructors

CliHelpBuilder Initializes a new instance of the CliHelpBuilder class.

Methods

GetLayout Gets the default sections to be written for command line help.
GetTwoColumnRow Gets a help item for the specified symbol.
Write Writes help output for the specified command.
(Overrides HelpBuilder.Write(HelpContext))
WriteAdditionalArgumentsSection Writes a help section describing a command's additional arguments, typically shown only when TreatUnmatchedTokensAsErrors is set to .
WriteColumns Writes the specified help rows, aligning output in columns.
WriteCommandArgumentsSection Writes a help section describing a command's arguments. Similar to:
console
Arguments:
  <argument-1>  Description for Argument1 [required]
WriteCommandOptionsSection Writes a help section describing a command's options. Similar to:
console
Options:
  -o, --option-1 <option-1>  Description for Option1 [default: DefaultForOption1]
  -v, --version              Show version information
  -?, -h, --help             Show help and usage information
WriteCommandUsageSection Writes a help section describing a command's usage. Similar to:
console
Usage:
  TestApp <argument-1> [command] [options]
WriteSubcommandsSection Writes a help section describing a command's subcommands. Similar to:
console
Commands:
  level-1  A nested level 1 sub-command
WriteSynopsisSection Writes a help section describing a command's synopsis. Similar to:
console
DotMake Command-Line TestApp v1.6.0
Copyright © 2023-2024 DotMake

A root cli command with nested children

See Also