# _Option
<span class="source-link">[[Source]](src/options/options.md#L289)</span>
```pony
class ref _Option
```

## Constructors

### create
<span class="source-link">[[Source]](src/options/options.md#L313)</span>


```pony
new ref create(
  long': String val,
  short': (String val | None val),
  arg': (None val | StringArgument val | I64Argument val | 
    U64Argument val | F64Argument val),
  mode': (Required val | Optional val))
: _Option ref^
```
#### Parameters

*   long': [String](builtin-String) val
*   short': ([String](builtin-String) val | [None](builtin-None) val)
*   arg': ([None](builtin-None) val | [StringArgument](options-StringArgument) val | [I64Argument](options-I64Argument) val | 
    [U64Argument](options-U64Argument) val | [F64Argument](options-F64Argument) val)
*   mode': ([Required](options-Required) val | [Optional](options-Optional) val)

#### Returns

* [_Option](options-_Option) ref^

---

## Public fields

### let long: [String](builtin-String) val
<span class="source-link">[[Source]](src/options/options.md#L290)</span>

Long option name.

E.g. "help" for a "--help" option.




---

### let short: ([String](builtin-String) val | [None](builtin-None) val)
<span class="source-link">[[Source]](src/options/options.md#L296)</span>

Short option name (if any).

E.g. "h" for a "-h" option.




---

### let arg: ([None](builtin-None) val | [StringArgument](options-StringArgument) val | [I64Argument](options-I64Argument) val | 
    [U64Argument](options-U64Argument) val | [F64Argument](options-F64Argument) val)
<span class="source-link">[[Source]](src/options/options.md#L302)</span>

The type of the expected argument.

None, if this option is a flag.

E.g. "--help"




---

### let mode: ([Required](options-Required) val | [Optional](options-Optional) val)
<span class="source-link">[[Source]](src/options/options.md#L310)</span>

determining if this Option is required or optional



---

## Public Functions

### matches
<span class="source-link">[[Source]](src/options/options.md#L324)</span>


```pony
fun box matches(
  name: String box,
  shortmatch: Bool val)
: Bool val
```
#### Parameters

*   name: [String](builtin-String) box
*   shortmatch: [Bool](builtin-Bool) val

#### Returns

* [Bool](builtin-Bool) val

---

### has_argument
<span class="source-link">[[Source]](src/options/options.md#L331)</span>


```pony
fun box has_argument()
: Bool val
```

#### Returns

* [Bool](builtin-Bool) val

---

### requires_argument
<span class="source-link">[[Source]](src/options/options.md#L337)</span>


```pony
fun box requires_argument()
: Bool val
```

#### Returns

* [Bool](builtin-Bool) val

---

### accepts
<span class="source-link">[[Source]](src/options/options.md#L345)</span>


```pony
fun box accepts(
  argument: String box)
: Bool val
```
#### Parameters

*   argument: [String](builtin-String) box

#### Returns

* [Bool](builtin-Bool) val

---

