Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ArgumentsReader

Obtains option values from command-line arguments

Hierarchy

  • ArgumentsReader

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

  • Parameters

    • priority: number
    • Optional args: string[]

    Returns ArgumentsReader

Properties

Private args

args: any

Readonly name

name: "arguments" = "arguments"

The name of this reader so that it may be removed by plugins without the plugin accessing the instance performing the read. Multiple readers may have the same name.

Readonly priority

priority: number

Readers will be processed according to their priority. A higher priority indicates that the reader should be called later so that it can override options set by lower priority readers.

Note that to preserve expected behavior, the argv reader must have both the lowest priority so that it may set the location of config files used by other readers and the highest priority so that it can override settings from lower priority readers.

Methods

read

  • read(container: Options, logger: Logger): void
  • Read options from the reader's source and place them in the options parameter. Options without a declared name may be treated as if they were declared with type ParameterType.Mixed. Options which have been declared must be converted to the correct type. As an alternative to doing this conversion in the reader, the reader may use Options.setValue, which will correctly convert values.

    Parameters

    • container: Options
    • logger: Logger

    Returns void

Generated using TypeDoc