Options
All
  • Public
  • Public/Protected
  • All
Menu

Class VaultAction

Hierarchy

  • CommandLineAction
    • VaultAction

Index

Constructors

constructor

  • Returns VaultAction

Properties

Private _filter

_filter: CommandLineChoiceParameter

Private _format

_format: CommandLineChoiceParameter

Private _getCodes

_getCodes: CommandLineFlagParameter

Private _privkey

_privkey: CommandLineStringParameter

Private _pubkey

_pubkey: CommandLineStringParameter

Private _revoke

_revoke: CommandLineStringParameter

Private _safe

_safe: CommandLineStringParameter

Readonly actionName

actionName: string

{@inheritDoc ICommandLineActionOptions.actionName}

Readonly documentation

documentation: string

{@inheritDoc ICommandLineActionOptions.documentation}

Readonly summary

summary: string

{@inheritDoc ICommandLineActionOptions.summary}

Accessors

parameters

  • get parameters(): ReadonlyArray<CommandLineParameter>
  • Returns a collection of the parameters that were defined for this object.

    Returns ReadonlyArray<CommandLineParameter>

remainder

  • get remainder(): CommandLineRemainder | undefined
  • If {@link CommandLineParameterProvider.defineCommandLineRemainder} was called, this object captures any remaining command line arguments after the recognized portion.

    Returns CommandLineRemainder | undefined

Methods

defineChoiceParameter

  • defineChoiceParameter(definition: ICommandLineChoiceDefinition): CommandLineChoiceParameter
  • Defines a command-line parameter whose value must be a string from a fixed set of allowable choices (similar to an enum).

    remarks

    Example of a choice parameter:

    example-tool --log-level warn

    Parameters

    • definition: ICommandLineChoiceDefinition

    Returns CommandLineChoiceParameter

defineCommandLineRemainder

  • defineCommandLineRemainder(definition: ICommandLineRemainderDefinition): CommandLineRemainder
  • Defines a rule that captures any remaining command line arguments after the recognized portion.

    remarks

    This feature is useful for commands that pass their arguments along to an external tool, relying on that tool to perform validation. (It could also be used to parse parameters without any validation or documentation, but that is not recommended.)

    Example of capturing the remainder after an optional flag parameter.

    example-tool --my-flag this is the remainder

    In the "--help" documentation, the remainder rule will be represented as "...".

    Parameters

    • definition: ICommandLineRemainderDefinition

    Returns CommandLineRemainder

defineFlagParameter

  • defineFlagParameter(definition: ICommandLineFlagDefinition): CommandLineFlagParameter
  • Defines a command-line switch whose boolean value is true if the switch is provided, and false otherwise.

    remarks

    Example usage of a flag parameter:

    example-tool --debug

    Parameters

    • definition: ICommandLineFlagDefinition

    Returns CommandLineFlagParameter

defineIntegerParameter

  • defineIntegerParameter(definition: ICommandLineIntegerDefinition): CommandLineIntegerParameter
  • Defines a command-line parameter whose argument is an integer.

    remarks

    Example usage of an integer parameter:

    example-tool --max-attempts 5

    Parameters

    • definition: ICommandLineIntegerDefinition

    Returns CommandLineIntegerParameter

defineStringListParameter

  • defineStringListParameter(definition: ICommandLineStringListDefinition): CommandLineStringListParameter
  • Defines a command-line parameter whose argument is a single text string. The parameter can be specified multiple times to build a list.

    remarks

    Example usage of a string list parameter:

    example-tool --add file1.txt --add file2.txt --add file3.txt

    Parameters

    • definition: ICommandLineStringListDefinition

    Returns CommandLineStringListParameter

defineStringParameter

  • defineStringParameter(definition: ICommandLineStringDefinition): CommandLineStringParameter
  • Defines a command-line parameter whose argument is a single text string.

    remarks

    Example usage of a string parameter:

    example-tool --message "Hello, world!"

    Parameters

    • definition: ICommandLineStringDefinition

    Returns CommandLineStringParameter

getChoiceParameter

  • getChoiceParameter(parameterLongName: string): CommandLineChoiceParameter
  • Returns the CommandLineChoiceParameter with the specified long name.

    remarks

    This method throws an exception if the parameter is not defined.

    Parameters

    • parameterLongName: string

    Returns CommandLineChoiceParameter

getFlagParameter

  • getFlagParameter(parameterLongName: string): CommandLineFlagParameter
  • Returns the CommandLineFlagParameter with the specified long name.

    remarks

    This method throws an exception if the parameter is not defined.

    Parameters

    • parameterLongName: string

    Returns CommandLineFlagParameter

getIntegerParameter

  • getIntegerParameter(parameterLongName: string): CommandLineIntegerParameter
  • Returns the CommandLineIntegerParameter with the specified long name.

    remarks

    This method throws an exception if the parameter is not defined.

    Parameters

    • parameterLongName: string

    Returns CommandLineIntegerParameter

getStringListParameter

  • getStringListParameter(parameterLongName: string): CommandLineStringListParameter
  • Returns the CommandLineStringListParameter with the specified long name.

    remarks

    This method throws an exception if the parameter is not defined.

    Parameters

    • parameterLongName: string

    Returns CommandLineStringListParameter

getStringParameter

  • getStringParameter(parameterLongName: string): CommandLineStringParameter
  • Returns the CommandLineStringParameter with the specified long name.

    remarks

    This method throws an exception if the parameter is not defined.

    Parameters

    • parameterLongName: string

    Returns CommandLineStringParameter

Protected onDefineParameters

  • onDefineParameters(): void
  • Returns void

Protected onExecute

  • onExecute(): Promise<void>
  • Returns Promise<void>

renderHelpText

  • renderHelpText(): string
  • Generates the command-line help text.

    Returns string

Generated using TypeDoc