PositionalOption

flitter-cli/options/PositionalOption~ PositionalOption

A positional CLI option. Defined without a flag.


Constructor

new PositionalOption(name, message)

Instantiate the option.

Parameters:
Name Type Description
name string

the name of the option

message string

message describing the option

Extends

Members

(private) _blacklist :Array.<*>

Blacklisted values.

Type:
  • Array.<*>

(private) _equality_value :*

The value to be used to check equality.

Type:
  • *

(private) _greater_than_bit :boolean

If true, the greater than will be greater than or equal to.

Type:
  • boolean

(private) _greater_than_value :*

Value to be compared in greater than.

Type:
  • *

(private) _less_than_bit :boolean

If true, the less than will be less than or equal to.

Type:
  • boolean

(private) _less_than_value :*

Value to be compared in less than.

Type:
  • *

(private) _optional :boolean

Is this option optional?

Type:
  • boolean

(private) _use_blacklist :boolean

Do we use the blacklist?

Type:
  • boolean

(private) _use_equality :boolean

Do we use the equality operator?

Type:
  • boolean

(private) _use_greater_than :boolean

Do we use the greater-than comparison?

Type:
  • boolean

(private) _use_less_than :boolean

Do we use the less-than comparison?

Type:
  • boolean

(private) _use_whitelist :boolean

Do we use the whitelist?

Type:
  • boolean

(private) _whitelist :Array.<*>

Whitelisted values.

Type:
  • Array.<*>

argument_name

Gets the name of the option.

message :string

Message describing the option.

Type:
  • string

name :string

The name of the option.

Type:
  • string

requirement_displays

Get an array of strings denoting the human-readable requirements for this option to be valid.

Methods

blacklist(…items)

Blacklist the specified item or items and enable the blacklist.

Parameters:
Name Type Attributes Description
items * <repeatable>

the items to blacklist

equals(value)

Specifies the value to be used in equality comparison and enables that comparison.

Parameters:
Name Type Description
value *

greater_than(value)

Specifies the value to be used in greater-than comparison and enables that comparison.

Parameters:
Name Type Description
value *

greater_than_equal_to(value)

Specifies the value to be used in greater-than or equal-to comparison and enables that comparison.

Parameters:
Name Type Description
value *

less_than(value)

Specifies the value to be used in less-than comparison and enables less-than comparison.

Parameters:
Name Type Description
value *

less_than_equal_to(value)

Specifies the value to be used in less-than or equal-to comparison and enables that comparison.

Parameters:
Name Type Description
value *

optional()

Sets the Option as optional.

validate(value) → {boolean}

Checks if the specified value passes the configured comparisons.

Parameters:
Name Type Description
value *
Returns:
Type
boolean

whitelist(…items)

Whitelist the specified item or items and enable the whitelist.

Parameters:
Name Type Attributes Description
items * <repeatable>

the items to whitelist