Class BuiltinAbstract

Represents a builtin command (such as help, version information) within a parser configuration.

These are contained separately from Commands because they may be triggered by flags, and will always require special casing when being executed.

A builtin match will always override user commands, and will halt argument coercion.

Hierarchy

  • Builtin

Constructors

Properties

argumentTriggers: string[] = []
commandTriggers: string[] = []
id: string

Methods

  • Generate the help string for this builtin. Describes the triggers which this builtin runs on.

    Returns

    The generated help string

    Returns string

  • Adds a flag to the known argument triggers for this builtin

    Returns

    this

    Parameters

    • argument: string

    Returns Builtin

  • Adds a command to the known command triggers for this builtin

    Returns

    this

    Parameters

    • command: string

      The command to trigger this builtin on

    Returns Builtin

  • Execute a builtin.

    Parameters

    • parser: Args<{}>

      The current parser

    • flags: Record<string, string[]>

      The raw flag arguments

    • positionals: string[]

      The raw positional arguments

    • trigger: string

      The flag / command that triggered this builtin

    Returns Promise<void>

Generated using TypeDoc