Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NumberArgument

Hierarchy

Index

Properties

Private forceNegative

forceNegative: boolean = false

Private forcePositive

forcePositive: boolean = false

Private int

int: boolean = false

Private max

max: number | null = null

Private min

min: number | null = null

Methods

getDefault

  • getDefault(): any

getManual

  • getManual(): string

getName

  • getName(): string

hasDefault

  • hasDefault(): boolean

integer

  • integer(): this

isOptional

  • isOptional(): boolean

maximum

  • maximum(max: number): this

minimum

  • minimum(min: number): this

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

negative

  • negative(): 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

positive

  • positive(): this

validate

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

Generated using TypeDoc