Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AbstractHelpGenerator

Hierarchy

Implements

Index

Constructors

constructor

Properties

Protected groupToOption

groupToOption: {}

A map of group names to option names and aliases - useful in help text/doc generation e.g. this.grouptoOption["job options"] -> [ "--async | -a ", "--activate | -A"]

Type declaration

  • [key: string]: string[]

Protected mCommandDefinition

mCommandDefinition: ICommandDefinition

The command definition for which we are building help

Protected mDefinitionTree

mDefinitionTree: ICommandDefinition

The full command definition - which includes the parents of the command.

Protected mExperimentalCommandDescription

mExperimentalCommandDescription: string = Constants.DEFAULT_EXPERIMENTAL_COMMAND_EXPLANATION

The configured experimental command description. Has a default, generic description which can be overridden through parameters to the constructor

Protected mLog

mLog: Logger

Logger

Protected mPrimaryHighlightColor

mPrimaryHighlightColor: string

Protected mProduceMarkdown

mProduceMarkdown: boolean = false

Produce markdown - not help text.

Protected mRootCommandName

mRootCommandName: string

The command name being invoked by the user. For example, when using "banana --help", banana is the command name.

Protected optionToDescription

optionToDescription: {}

A map of option names and aliases to their descriptions - useful in help text/doc generation e.g. this.optionToDescription["--async | a"] -> "Don't wait for this job to complete before returning"

Type declaration

  • [key: string]: string

Static LONG_DASH

LONG_DASH: string = "--"

Static SHORT_DASH

SHORT_DASH: string = "-"

Accessors

Protected log

Methods

Abstract buildFullCommandHelpText

  • buildFullCommandHelpText(includeGlobalOptions: boolean): string

Abstract buildHelp

  • buildHelp(): string

Protected buildOptionMaps

  • buildOptionMaps(): void

Protected dimGrey

  • dimGrey(text: string): any

Protected explainType

Protected getCaseSensitiveFlagByOptionName

  • getCaseSensitiveFlagByOptionName(optionName: string): boolean

getOptionAndAliasesString

Protected grey

  • grey(text: string): any

Protected renderHelp

  • renderHelp(help: string): string

Static formatHelpHeader

  • formatHelpHeader(header: string, indent?: string, color: string): string
  • Get a heading for the CLI / help

    Parameters

    • header: string

      The text you want to display in the header

    • Default value indent: string = " "

      prefix the the heading and dashes with this string (defaults to one space)

    • color: string

      the color to highlight the header in

    Returns string

    the formatted/colored header

Generated using TypeDoc