KC's Workspace
    Preparing search index...
    Index

    Constructors

    • Initialize a new command argument with the given name and description. The default is that the argument is required, and you can explicitly indicate this with <> around the name. Put [] around the name for an optional argument.

      Parameters

      • arg: string
      • Optionaldescription: string

      Returns Argument

    Properties

    argChoices?: string[]
    defaultValue?: any
    defaultValueDescription?: string
    description: string
    parseArg?: <T>(value: string, previous: T) => T
    required: boolean
    variadic: boolean

    Methods

    • Make argument optional.

      Returns this

    • Set the custom handler for processing CLI command arguments into argument values.

      Type Parameters

      • T

      Parameters

      • fn: (value: string, previous: T) => T

      Returns this

    • Make argument required.

      Returns this

    • Only allow argument value to be one of choices.

      Parameters

      • values: readonly string[]

      Returns this

    • Set the default value, and optionally supply the description to be displayed in the help.

      Parameters

      • value: unknown
      • Optionaldescription: string

      Returns this

    • Return argument name.

      Returns string