Skip to main content
Module

x/denomander/mod.ts>Option

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

Class that only handles the custom option form the user (it is not used but it reasign the proper Option object)

Constructors

new
Option(params: CommandOption)

Constructor of Command object

Properties

protected
optional
_letter_option: string

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

protected
_word_option: string

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

optional
_callback: Function

The custom option processing function

_description: string

The description of the option

_flags: string

Holds the flags as defined (unparsed)

_isRequired: boolean

If the option is required

optional
all_choices: Array<any>
optional
defaultValue: any

Holds the default value if passed

Methods

callback(callback: Function): CustomOption
choices(choices: Array<any>): CustomOption
default(defaultValue: any): CustomOption

Set the default value if not setted in constructor

description(description: string): CustomOption
flags(flags: string): CustomOption
isRequired(isRequired: boolean): CustomOption