Manual Reference Source Test
public class | source

Cli

Class The class for the command line interface.

Test:

Constructor Summary

Public Constructor
public

constructor(PopApi: PopApi, options: Object)

Create a new Cli object.

Member Summary

Public Members
public

The name of the Cli program.

public

The command line parser to process the Cli inputs.

public

The version of the Cli program.

Method Summary

Public Methods
public

Get the help message.

public

Initiate the options for the Cli.

public

Handle the --mode Cli option.

public

Method for displaying the --help option

public

run(PopApi: PopApi, argv: Array<string>): undefined

Run the Cli program.

Public Constructors

public constructor(PopApi: PopApi, options: Object) source

Create a new Cli object.

Params:

NameTypeAttributeDescription
PopApi PopApi
  • nullable: false

The PopApi instance to bind the cli to.

options Object
  • nullable: false

The options for the cli.

options.argv Array<string>
  • nullable: true

The arguments to be parsed by commander.

options.name string
  • nullable: false

The name of the Cli program.

options.version string
  • nullable: false

The version of the Cli program.

Test:

Public Members

public name: string source

The name of the Cli program.

public program: Object source

The command line parser to process the Cli inputs.

public version: string source

The version of the Cli program.

Public Methods

public getHelp(): Array<string> source

Get the help message.

Return:

Array<string>

The help message to print.

Test:

public initOptions(): undefined source

Initiate the options for the Cli.

Return:

undefined

Test:

public mode(m: string): Object source

Handle the --mode Cli option.

Params:

NameTypeAttributeDescription
m string
  • optional
  • nullable: true

The mode to run the API in.

Return:

Object

The options to pass to the Logger middleware.

Test:

public printHelp(): undefined source

Method for displaying the --help option

Return:

undefined

Test:

public run(PopApi: PopApi, argv: Array<string>): undefined source

Run the Cli program.

Params:

NameTypeAttributeDescription
PopApi PopApi
  • nullable: false

The PopApi instance to bind the logger to.

argv Array<string>
  • nullable: true

The arguments to be parsed by commander.

Return:

undefined

Test: