Options
All
  • Public
  • Public/Protected
  • All
Menu

Command utility class. Place static utils for command processing here.

Hierarchy

  • CommandUtils

Index

Methods

Static flattenCommandTree

Static getFullCommandName

Static getOptionDefinitionFromName

Static optionWasSpecified

  • optionWasSpecified(optionName: string, commandDefinition: ICommandDefinition, args: ICommandArguments["args"]): boolean

Static reconstructCommand

  • reconstructCommand(commandArguments: Arguments, commandDefinition: ICommandDefinition): string
  • Get a representation of the original command as issued by the user .with all canonical forms of options specified. You only need to supply the "command" segement of your command. The "full command" (including previous groups, etc.) is extracted from the yargs arguments object "_" property. TODO: Replace "maincommand" below with the name of the bin - This is new to Imperative.

    Parameters

    • commandArguments: Arguments

      The Yargs style argument object. Requires the "_" (input argv)

    • commandDefinition: ICommandDefinition

      The command definition document

    Returns string

    • The reconstructed command (as would have been issued on the console).

Generated using TypeDoc