Constructor
new PositionalOption(name, message)
Instantiate the option.
Name | Type | Description |
---|---|---|
name |
string | the name of the option |
message |
string | message describing the option |
- Source:
Extends
Members
(private) _blacklist :Array.<*>
Blacklisted values.
- Array.<*>
- Source:
(private) _equality_value :*
The value to be used to check equality.
- *
- Source:
(private) _greater_than_bit :boolean
If true, the greater than will be greater than or equal to.
- boolean
- Source:
(private) _greater_than_value :*
Value to be compared in greater than.
- *
- Source:
(private) _less_than_bit :boolean
If true, the less than will be less than or equal to.
- boolean
- Source:
(private) _less_than_value :*
Value to be compared in less than.
- *
- Source:
(private) _optional :boolean
Is this option optional?
- boolean
- Source:
(private) _use_blacklist :boolean
Do we use the blacklist?
- boolean
- Source:
(private) _use_equality :boolean
Do we use the equality operator?
- boolean
- Source:
(private) _use_greater_than :boolean
Do we use the greater-than comparison?
- boolean
- Source:
(private) _use_less_than :boolean
Do we use the less-than comparison?
- boolean
- Source:
(private) _use_whitelist :boolean
Do we use the whitelist?
- boolean
- Source:
(private) _whitelist :Array.<*>
Whitelisted values.
- Array.<*>
- Source:
argument_name
Gets the name of the option.
- Source:
message :string
Message describing the option.
- string
- Source:
name :string
The name of the option.
- string
- Source:
requirement_displays
Get an array of strings denoting the human-readable requirements for this option to be valid.
- Source:
Methods
blacklist(…items)
Blacklist the specified item or items and enable the blacklist.
Name | Type | Attributes | Description |
---|---|---|---|
items |
* |
<repeatable> |
the items to blacklist |
- Source:
equals(value)
Specifies the value to be used in equality comparison and enables that comparison.
Name | Type | Description |
---|---|---|
value |
* |
- Source:
greater_than(value)
Specifies the value to be used in greater-than comparison and enables that comparison.
Name | Type | Description |
---|---|---|
value |
* |
- Source:
greater_than_equal_to(value)
Specifies the value to be used in greater-than or equal-to comparison and enables that comparison.
Name | Type | Description |
---|---|---|
value |
* |
- Source:
less_than(value)
Specifies the value to be used in less-than comparison and enables less-than comparison.
Name | Type | Description |
---|---|---|
value |
* |
- Source:
less_than_equal_to(value)
Specifies the value to be used in less-than or equal-to comparison and enables that comparison.
Name | Type | Description |
---|---|---|
value |
* |
- Source:
optional()
Sets the Option as optional.
- Source:
validate(value) → {boolean}
Checks if the specified value passes the configured comparisons.
Name | Type | Description |
---|---|---|
value |
* |
- Source:
- Type
- boolean
whitelist(…items)
Whitelist the specified item or items and enable the whitelist.
Name | Type | Attributes | Description |
---|---|---|---|
items |
* |
<repeatable> |
the items to whitelist |
- Source: