Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UsageDirective

Directive that prints the help message and usage information about directives registered with the command line utility.

Hierarchy

Index

Constructors

constructor

Properties

Protected Readonly cli

Protected Readonly logging

logging: Logging

Accessors

Private appClassApplication

Methods

Protected app

Protected container

debug

  • debug(output: unknown): void

didRequestUsage

  • didRequestUsage(argv: string[]): boolean
  • Determines if, at any point in the arguments, the help option's short or long flag appears.

    Parameters

    • argv: string[]

    Returns boolean

    • true if the help flag appeared

error

  • error(output: unknown): void

getBoundMethod

  • getBoundMethod(methodName: string): (...args: any[]) => any
  • Get the method with the given name from this class, bound to this class.

    Parameters

    • methodName: string

    Returns (...args: any[]) => any

    function

      • (...args: any[]): any
      • Parameters

        • Rest ...args: any[]

        Returns any

getDescription

  • getDescription(): string

getHelpOption

getHelpText

  • getHelpText(): string

getKeywords

  • getKeywords(): string | string[]

getMainKeyword

  • getMainKeyword(): string

getOptions

getResolvedOptions

handle

  • handle(): void | Promise<void>

info

  • info(output: unknown): void

Protected instantiateOptionFromString

  • instantiateOptionFromString(string: string): CLIOption<any>
  • Create an instance of CLIOption based on a string definition of a particular format.

    e.g. '{file name} | canonical name of the resource to create' e.g. '--push -p {value} | the value to be pushed' e.g. '--force -f | do a force push'

    Parameters

    • string: string

    Returns CLIOption<any>

invoke

  • invoke(argv: string[]): Promise<void>
  • Invoke this directive with the specified arguments.

    If usage was requested (see didRequestUsage()), it prints the extended usage info.

    Otherwise, it parses the options from argv and calls handle().

    Parameters

    • argv: string[]

    Returns Promise<void>

Protected make

  • make<T>(target: any, ...parameters: any[]): T

matchesKeyword

  • matchesKeyword(name: string): boolean

Protected nativeOutput

  • nativeOutput(...outputs: any[]): void

option

  • option(name: string, defaultValue?: unknown): any
  • Get the value of a parsed option. If none exists, return defaultValue.

    Parameters

    • name: string
    • Optional defaultValue: unknown

    Returns any

parseOptions

  • parseOptions(options: CLIOption<any>[], args: string[]): {}
  • Process the raw CLI arguments using an array of option class instances to build a mapping of option names to provided values.

    Parameters

    Returns {}

    • [key: string]: any

success

  • success(output: unknown): void

Protected untilInterrupt

  • untilInterrupt(callback?: () => unknown): Promise<void>
  • Get a promise that resolves after SIGINT is received, executing a callback beforehand.

    Parameters

    • Optional callback: () => unknown
        • (): unknown
        • Returns unknown

    Returns Promise<void>

verbose

  • verbose(output: unknown): void

warn

  • warn(output: unknown): void
Extollo Logo

extollo (v. latin) - to lift up, to elevate

Extollo is a free & libre application framework in TypeScript.