Options
Modules
  • Command
  • Localization
  • Logger
All
  • Public
  • Public/Protected
  • All
Menu

Represents a flag type command argument. The value field will be true if the flag was passed in the command input

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Flag(ident: string, raw?: CommandArgKindImplFlag): Flag

Properties

count

count: number

How many times this flag was passed

ident

ident: string

The identifier for this argument. This will be the identifier specified in the Command's arguments specification within your custom commands.

NOTE: This is guaranteed to be a string for flags and options, but can be undefined for operands as extra, undeclared operands can be given and parsed

Optional raw

raw: ArgumentParseNode

The raw argument as returned from the argument parser for this argument. This will be undefined for non-required arguments that were unpassed.

The fields you can expect if present depend on the argument type, but can consist of the following:

{
    kind: number;
    index: number;
    ident?: string;
    type?: string;
    value?: string;
    long?: string;
}

NOTE: This is exposed mostly for use in error handling as the info it contains may be useful for your error output

value

value: boolean

The value this flag holds. You can expect it to be false if the flag was not passed to the command when it was called, and true otherwise

Methods

increment

  • increment(): void

isSome

  • isSome(): this is Required<Flag>

Generated using TypeDoc