Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Argument

Hierarchy

Index

Properties

Private argDefault

argDefault: any = undefined

Private argDisplay

argDisplay: string = "_"

Private argDisplayDefault

argDisplayDefault: boolean = true

Private argName

argName: string = "_"

Private argOptional

argOptional: boolean = false

Methods

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

Abstract validate

  • validate(args: string): Array<any>

Generated using TypeDoc