Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "lib/command"

Index

Functions

cliCommand

  • cliCommand(fn: function): Promise<never>
  • Call the provided function with the provided arguments and capture any errors. When the function is complete, process.exit will be called with the appropriate code, i.e., this function will never return.

    Parameters

    • fn: function

      function providing the desired command and returning a Promise of an integer exit value.

        • (): Promise<number>
        • Returns Promise<number>

    Returns Promise<never>

extractArgs

  • extractArgs(args: string[]): Arg[]
  • Parse positional parameters into parameter name/value pairs. The positional parameters should be of the form NAME[=VALUE]. If =VALUE is omitted, the value is set to undefined. If the VALUE is empty, i.e., NAME=, then the value is the empty string.

    Parameters

    • args: string[]

      typically argv._ from yargs

    Returns Arg[]

    array of CommandInvocation Arg

isEmbeddedSdmCommand

  • isEmbeddedSdmCommand(args: string[]): boolean
  • Does this command start up an embedded SDM?

    Parameters

    • args: string[]

      command-line arguments, typically process.argv

    Returns boolean

shouldAddLocalSdmCommands

  • shouldAddLocalSdmCommands(args: string[]): boolean
  • Determine whether sdm-local commands should be loaded. To improve startup times and eliminate client startup when unnecessary, we do not load the sdm-local commands if we are just running a native CLI command.

    Parameters

    • args: string[]

      command-line arguments, typically process.argv

    Returns boolean

    true if the SDM local commands should be loaded

Generated using TypeDoc