Options
All
  • Public
  • Public/Protected
  • All
Menu

Main program registry

Hierarchy

  • Program

Index

Constructors

constructor

Properties

root

root: Collector

Accessors

config

config:

getter for the resolved configuration

version

version:

get the version specified for the program

Methods

exec

  • exec(argv: string[], path?: string[]): Promise<void>
  • execute the argv against the registered commands

    Parameters

    • argv: string[]

      argv as passthrough to the command collector

    • Default value path: string[] = []

      command invocation path

    Returns Promise<void>

globalHelp

  • globalHelp(heading: string, body?: string, raw?: boolean): Program
  • Add help text to the main program

    Parameters

    • heading: string

      Add ui heading

    • Optional body: string

      Help text to show

    • Optional raw: boolean

      Flag to output the raw text without formatting

    Returns Program

globalOption

help

registerCommand

  • register a resolved command by its name and constructor

    Parameters

    • tree: string[]
    • Optional ctor: ICommandCtor

      the instance contstructor

    • Optional subcommands: ICommandDefinition[]

      Subcommands of the parent. If zero-length array, it is assumed subcommands exist so '' will be used

    Returns Collector

registerCommandHelp

  • Register a command for help context

    Parameters

    • names: string[]

      the command names (hierarchy) to be registered

    • Optional ctor: ICommandCtor

      the command implementation constructor

    • Optional subcommands: ICommandDefinition[]

    Returns Collector

registerRoot

  • Register a class as the handler for the root command

    Parameters

    • Optional ctor: ICommandCtor

      The root command "default" implementation

    Returns Collector