Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GroupArgument

Hierarchy

Index

Constructors

constructor

Properties

Private arguments

arguments: Argument[] = []

Private type

type: Type

Methods

addArgument

getDefault

  • getDefault(): any

getManual

  • getManual(): string

getName

  • getName(): string

hasDefault

  • hasDefault(): boolean

isOptional

  • isOptional(): boolean

name

  • name(name: string, display?: undefined | string): this
  • Sets a name for the argument to identify it later when the command gets dispatched This name will be used when passing the parsed argument to the exec function

    Parameters

    • name: string

      sets the name of the argument

    • Optional display: undefined | string

      sets a beautified display name which will be used when the getManual command gets executed, if none given it will use the first parameter as display value

    Returns this

optional

  • optional(fallback?: any, displayDefault?: boolean): this
  • Sets an Argument as optional if the argument has not been parsed successful it will use the first argument which has been given inside this method

    Parameters

    • Optional fallback: any

      the default value which should be set if this parameter has not been found

    • Default value displayDefault: boolean = true

      wether it should display the default value when called with the #getUsage method

    Returns this

Private validate

  • validate(args: string): (string | object)[]

Private validateAnd

  • validateAnd(args: string): (string | object)[]
  • Validates the given string to the "and" of the GroupArgument

    Parameters

    • args: string

      the remaining args

    Returns (string | object)[]

Private validateOr

  • validateOr(args: string): (string | object)[]
  • Validates the given string to the "or" of the GroupArgument

    Parameters

    • args: string

      the remaining args

    Returns (string | object)[]

Generated using TypeDoc