Skip to main content
Module

x/denomander/docs.ts>Option

Deno command-line interfaces made easy
Latest
class Option
Re-export
import { Option } from "https://deno.land/x/denomander@0.9.3/docs.ts";

Option class

Constructors

new
Option(params: OptionParameters)

Constructor of Command object

Properties

protected
optional
_letter_option: string

Holds the short flag (-p). One letter command

protected
_value: any

The value of the option

protected
_word_option: string

Holds the long flag (--port). One letter command

optional
callback: Function

The custom option processing function

optional
choices: Array<any>
command: Command

The command that belongs to it

optional
defaultValue: any

Holds the default value if passed

description: string

The description of the option

flags: string

Holds the flags as defined (unparsed)

isRequired: boolean

If the option is required

letter_option: string | undefined

Getter of the the short flag (one letter command)

value: any

Getter of the long flag (word command)

word_option: string

Getter of the long flag (word command)

Methods

private
splitFlags()

It splits the pre declared commands and stores the word_option.

belongsTo(command: Command)

The command that belongs to it

hasDefaultValue(): boolean
reset(flags: string, description: string)

Set new flags and description for this option