Skip to content

Home > resol-vbus-core-toolbox > ArgParser

ArgParser class

A command-line argument parser.

Signature:

typescript
export declare class ArgParser

Constructors

Constructor

Modifiers

Description

(constructor)(args)

Create a new argument parser.

Properties

Property

Modifiers

Type

Description

args

string[]

List of arguments.

index

number

Current index.

Methods

Method

Modifiers

Description

consume()

Return the next argument and increment the internal index.

consumeArg(option)

Consume the next argument and make sure it is not an option.

peek(offset)

Peek at an argument/option at a specific offset.