Options
All
  • Public
  • Public/Protected
  • All
Menu

Parses CLI args using the yargs library. Specific settings can be enabled through the provided options.

Hierarchy

Index

Constructors

Properties

yargsArgOptions: YargsArgOptions
yargvOptions: CliOptions

Methods

  • canHandle(input: CliArgv): Promise<void>
  • Checks if the input can be handled by this class. If it cannot handle the input, rejects with an error explaining why.

    Parameters

    • input: CliArgv

      Input that could potentially be handled.

    Returns Promise<void>

    A promise resolving if the input can be handled, rejecting with an Error if not.

  • createYArgv(argv: readonly string[]): Argv<{}>
  • handle(argv: readonly string[]): Promise<{ $0: string; _: (string | number)[] }>
  • Handles the given input. This may only be called if canHandle did not reject. When unconditionally calling both in sequence, consider handleSafe instead.

    Parameters

    • argv: readonly string[]

    Returns Promise<{ $0: string; _: (string | number)[] }>

    A promise resolving when handling is finished.

  • handleSafe(input: CliArgv): Promise<Settings>